|
@@ -112,7 +112,7 @@ function __construct(){
|
|
}
|
|
}
|
|
return $thatDayOrder;
|
|
return $thatDayOrder;
|
|
}
|
|
}
|
|
- if(in_array($name,['alipearlstore','finsahair','baddiebeautyshop','yolissahair']))
|
|
|
|
|
|
+ if(in_array($name,['alipearlstore','finsahair','baddiebeautyshop','yolissahair','Yolissa']))
|
|
{
|
|
{
|
|
|
|
|
|
$post['shopify'] = $shopapi.'?status=any&limit=2';//?status=any所有订单 &limit=200每页多少单
|
|
$post['shopify'] = $shopapi.'?status=any&limit=2';//?status=any所有订单 &limit=200每页多少单
|
|
@@ -133,187 +133,284 @@ function __construct(){
|
|
curl_close($ch);
|
|
curl_close($ch);
|
|
$res = json_decode($res,true);
|
|
$res = json_decode($res,true);
|
|
|
|
|
|
- $thatDayOrder = array();
|
|
|
|
- $thatDayOrder = array();
|
|
|
|
- if(isset($res['orders']))
|
|
|
|
- {
|
|
|
|
- foreach ($res['orders'] as $v)
|
|
|
|
- {
|
|
|
|
- $productNames = '';
|
|
|
|
- $parameters = array();
|
|
|
|
- $skus = '';
|
|
|
|
- $quantity = '';
|
|
|
|
- $thislink = '';
|
|
|
|
- foreach($v['line_items'] as $key=>$val)
|
|
|
|
- {
|
|
|
|
- $productNames .= ($key > 0)?','.$val['name']:$val['name'];
|
|
|
|
- $skus .= ($key > 0)?','.$val['sku']:$val['sku'];
|
|
|
|
- $quantity .= floor($val['quantity']).';';
|
|
|
|
- }
|
|
|
|
- if(stripos($v['payment_gateway_names'][0],'shopify_') !== false)
|
|
|
|
- {
|
|
|
|
- $pay = 'shopifypay';
|
|
|
|
- }
|
|
|
|
- else if(stripos($v['payment_gateway_names'][0],'paypal') !== false)
|
|
|
|
- {
|
|
|
|
- $pay = 'paypal_express';
|
|
|
|
- }
|
|
|
|
- else if(stripos($v['payment_gateway_names'][0],'gift_card') !== false)
|
|
|
|
- {
|
|
|
|
- $pay = 'gift_card';
|
|
|
|
- }
|
|
|
|
- else if(stripos($v['payment_gateway_names'][0],'shop_cash') !== false)
|
|
|
|
- {
|
|
|
|
- $pay = 'shop_cash';
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- $pay = $v['payment_gateway_names'][0];
|
|
|
|
- }
|
|
|
|
- $khbz = '';
|
|
|
|
- if(!isset($v['shipping_address']['country_code']))
|
|
|
|
- {
|
|
|
|
- $v['shipping_address'] = $v['billing_address'];
|
|
|
|
- $khbz = '客户自提订单; ';
|
|
|
|
- }
|
|
|
|
- $shipping_address = $v['shipping_address']['address2'].' '.$v['shipping_address']['address1'] . ',' . $v['shipping_address']['city'] . ',' . $v['shipping_address']['province'] . ',' . $v['shipping_address']['zip'] . ',' . $v['shipping_address']['country_code'] . ',' . $v['shipping_address']['phone'];
|
|
|
|
- @$billing_address = $v['billing_address']['address2'].' '.$v['billing_address']['address1'] . ',' . $v['billing_address']['city'] . ',' . $v['billing_address']['province'] . ',' . $v['billing_address']['zip'] . ',' . $v['billing_address']['country_code'] . ',' . $v['billing_address']['phone'];
|
|
|
|
- $created_at = explode('T',$v['created_at']);
|
|
|
|
- $created_at_hi = explode('-',$created_at[1]);
|
|
|
|
- $created_at = $created_at[0].' '.$created_at_hi[0];
|
|
|
|
- $paypal = '';
|
|
|
|
- $d = $this->authorization($shop,$v['id']);
|
|
|
|
- if($d['g'] == 1)
|
|
|
|
- {
|
|
|
|
- $paypal = $d['d'];
|
|
|
|
- }
|
|
|
|
- if($name == 'baddiebeautyshop')
|
|
|
|
- {
|
|
|
|
- $wcsku = '';
|
|
|
|
- $wcquantity = '';
|
|
|
|
- $ztsku = explode(',',rtrim($skus,','));
|
|
|
|
- $ztquantity = explode(';',rtrim($quantity,';'));
|
|
|
|
- foreach ($ztsku as $txk=>$txval)
|
|
|
|
- {
|
|
|
|
- $skupx = array(13=>'',22=>'',8=>'',15=>'',18=>'','100'=>'',33=>'',34=>'',35=>'',7=>'','dc'=>'','c'=>'',14=>'',12=>'',25=>'',26=>'',27=>'',10=>'',6=>'',9=>'',999=>'',9999=>'');
|
|
|
|
- $w = $this->whlabel->get_sku($txval);
|
|
|
|
- if(isset($w['features']))
|
|
|
|
- {
|
|
|
|
- $features = explode('-',trim($w['features'],'-'));
|
|
|
|
- foreach ($features as $val)
|
|
|
|
- {
|
|
|
|
- $t = $this->typeclass->read($val);
|
|
|
|
- if(isset($t['spare']))
|
|
|
|
- {
|
|
|
|
- if(stripos($t['spare'],'|') !== false)
|
|
|
|
- {
|
|
|
|
- $t['spare'] = explode('|',trim($t['spare'],'|'));
|
|
|
|
- $t['spare'] = $t['spare'][0];
|
|
|
|
- }
|
|
|
|
- $skupx[$t['classid']] = $t['spare'];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- $skupx = implode("-",$skupx);
|
|
|
|
- $skupx = str_replace('- ','-',trim($skupx,'-'));
|
|
|
|
- $skupx = str_replace(array('--------','-------','------','-----','----','---','--'),'-',$skupx);
|
|
|
|
- $wcsku .= $skupx.',';
|
|
|
|
- $wcquantity .= $ztquantity[$txk].',';
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if($wcsku == '')
|
|
|
|
- {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- $skus = rtrim($wcsku,',');
|
|
|
|
- $quantity = rtrim($wcquantity,',');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- $authorid = '';
|
|
|
|
- $wjauthorid = '';
|
|
|
|
- $sourcecontentid = '';
|
|
|
|
- $link = '';
|
|
|
|
- if($shop['tweak'] !='' && stripos($v['referring_site'],'author_id') !== false)
|
|
|
|
- {
|
|
|
|
- $geturl = explode('&',$v['referring_site']);
|
|
|
|
- foreach ($geturl as $hqid)
|
|
|
|
- {
|
|
|
|
- if(stripos($hqid,'author_id') !== false)
|
|
|
|
- {
|
|
|
|
- $wjauthorid = str_replace('author_id=','',$hqid);
|
|
|
|
- }
|
|
|
|
- if(stripos($hqid,'source_content_id') !== false)
|
|
|
|
- {
|
|
|
|
- $sourcecontentid = str_replace('source_content_id=','',$hqid);
|
|
|
|
- }
|
|
|
|
|
|
+ // $thatDayOrder = array();
|
|
|
|
+ // if(isset($res['orders']))
|
|
|
|
+ // {
|
|
|
|
+ // foreach ($res['orders'] as $v)
|
|
|
|
+ // {
|
|
|
|
+ // $productNames = '';
|
|
|
|
+ // $parameters = array();
|
|
|
|
+ // $skus = '';
|
|
|
|
+ // $quantity = '';
|
|
|
|
+ // $thislink = '';
|
|
|
|
+ // foreach($v['line_items'] as $key=>$val)
|
|
|
|
+ // {
|
|
|
|
+ // $productNames .= ($key > 0)?','.$val['name']:$val['name'];
|
|
|
|
+ // $skus .= ($key > 0)?','.$val['sku']:$val['sku'];
|
|
|
|
+ // $quantity .= floor($val['quantity']).';';
|
|
|
|
+ // }
|
|
|
|
+ // if(stripos($v['payment_gateway_names'][0],'shopify_') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $pay = 'shopifypay';
|
|
|
|
+ // }
|
|
|
|
+ // else if(stripos($v['payment_gateway_names'][0],'paypal') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $pay = 'paypal_express';
|
|
|
|
+ // }
|
|
|
|
+ // else if(stripos($v['payment_gateway_names'][0],'gift_card') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $pay = 'gift_card';
|
|
|
|
+ // }
|
|
|
|
+ // else if(stripos($v['payment_gateway_names'][0],'shop_cash') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $pay = 'shop_cash';
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // $pay = $v['payment_gateway_names'][0];
|
|
|
|
+ // }
|
|
|
|
+ // $khbz = '';
|
|
|
|
+ // if(!isset($v['shipping_address']['country_code']))
|
|
|
|
+ // {
|
|
|
|
+ // $v['shipping_address'] = $v['billing_address'];
|
|
|
|
+ // $khbz = '客户自提订单; ';
|
|
|
|
+ // }
|
|
|
|
+ // $shipping_address = $v['shipping_address']['address2'].' '.$v['shipping_address']['address1'] . ',' . $v['shipping_address']['city'] . ',' . $v['shipping_address']['province'] . ',' . $v['shipping_address']['zip'] . ',' . $v['shipping_address']['country_code'] . ',' . $v['shipping_address']['phone'];
|
|
|
|
+ // @$billing_address = $v['billing_address']['address2'].' '.$v['billing_address']['address1'] . ',' . $v['billing_address']['city'] . ',' . $v['billing_address']['province'] . ',' . $v['billing_address']['zip'] . ',' . $v['billing_address']['country_code'] . ',' . $v['billing_address']['phone'];
|
|
|
|
+ // $created_at = explode('T',$v['created_at']);
|
|
|
|
+ // $created_at_hi = explode('-',$created_at[1]);
|
|
|
|
+ // $created_at = $created_at[0].' '.$created_at_hi[0];
|
|
|
|
+ // $paypal = '';
|
|
|
|
+ // $d = $this->authorization($shop,$v['id']);
|
|
|
|
+ // if($d['g'] == 1)
|
|
|
|
+ // {
|
|
|
|
+ // $paypal = $d['d'];
|
|
|
|
+ // }
|
|
|
|
+ // if($name == 'baddiebeautyshop')
|
|
|
|
+ // {
|
|
|
|
+ // $wcsku = '';
|
|
|
|
+ // $wcquantity = '';
|
|
|
|
+ // $ztsku = explode(',',rtrim($skus,','));
|
|
|
|
+ // $ztquantity = explode(';',rtrim($quantity,';'));
|
|
|
|
+ // foreach ($ztsku as $txk=>$txval)
|
|
|
|
+ // {
|
|
|
|
+ // $skupx = array(13=>'',22=>'',8=>'',15=>'',18=>'','100'=>'',33=>'',34=>'',35=>'',7=>'','dc'=>'','c'=>'',14=>'',12=>'',25=>'',26=>'',27=>'',10=>'',6=>'',9=>'',999=>'',9999=>'');
|
|
|
|
+ // $w = $this->whlabel->get_sku($txval);
|
|
|
|
+ // if(isset($w['features']))
|
|
|
|
+ // {
|
|
|
|
+ // $features = explode('-',trim($w['features'],'-'));
|
|
|
|
+ // foreach ($features as $val)
|
|
|
|
+ // {
|
|
|
|
+ // $t = $this->typeclass->read($val);
|
|
|
|
+ // if(isset($t['spare']))
|
|
|
|
+ // {
|
|
|
|
+ // if(stripos($t['spare'],'|') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $t['spare'] = explode('|',trim($t['spare'],'|'));
|
|
|
|
+ // $t['spare'] = $t['spare'][0];
|
|
|
|
+ // }
|
|
|
|
+ // $skupx[$t['classid']] = $t['spare'];
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // $skupx = implode("-",$skupx);
|
|
|
|
+ // $skupx = str_replace('- ','-',trim($skupx,'-'));
|
|
|
|
+ // $skupx = str_replace(array('--------','-------','------','-----','----','---','--'),'-',$skupx);
|
|
|
|
+ // $wcsku .= $skupx.',';
|
|
|
|
+ // $wcquantity .= $ztquantity[$txk].',';
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // if($wcsku == '')
|
|
|
|
+ // {
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // $skus = rtrim($wcsku,',');
|
|
|
|
+ // $quantity = rtrim($wcquantity,',');
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // $authorid = '';
|
|
|
|
+ // $wjauthorid = '';
|
|
|
|
+ // $sourcecontentid = '';
|
|
|
|
+ // $link = '';
|
|
|
|
+ // if($shop['tweak'] !='' && stripos($v['referring_site'],'author_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $geturl = explode('&',$v['referring_site']);
|
|
|
|
+ // foreach ($geturl as $hqid)
|
|
|
|
+ // {
|
|
|
|
+ // if(stripos($hqid,'author_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $wjauthorid = str_replace('author_id=','',$hqid);
|
|
|
|
+ // }
|
|
|
|
+ // if(stripos($hqid,'source_content_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $sourcecontentid = str_replace('source_content_id=','',$hqid);
|
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
|
- $link = str_replace($shop['thurl'],$shop['url'],$v['referring_site']);
|
|
|
|
- }
|
|
|
|
- else if($shop['tweak'] !='' && stripos($v['landing_site'],'author_id') !== false)
|
|
|
|
- {
|
|
|
|
- $geturl = explode('&',$v['landing_site']);
|
|
|
|
- foreach ($geturl as $hqid)
|
|
|
|
- {
|
|
|
|
- if(stripos($hqid,'author_id') !== false)
|
|
|
|
- {
|
|
|
|
- $wjauthorid = str_replace('author_id=','',$hqid);
|
|
|
|
- }
|
|
|
|
- if(stripos($hqid,'source_content_id') !== false)
|
|
|
|
- {
|
|
|
|
- $sourcecontentid = str_replace('source_content_id=','',$hqid);
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
|
|
+ // $link = str_replace($shop['thurl'],$shop['url'],$v['referring_site']);
|
|
|
|
+ // }
|
|
|
|
+ // else if($shop['tweak'] !='' && stripos($v['landing_site'],'author_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $geturl = explode('&',$v['landing_site']);
|
|
|
|
+ // foreach ($geturl as $hqid)
|
|
|
|
+ // {
|
|
|
|
+ // if(stripos($hqid,'author_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $wjauthorid = str_replace('author_id=','',$hqid);
|
|
|
|
+ // }
|
|
|
|
+ // if(stripos($hqid,'source_content_id') !== false)
|
|
|
|
+ // {
|
|
|
|
+ // $sourcecontentid = str_replace('source_content_id=','',$hqid);
|
|
|
|
+ // }
|
|
|
|
|
|
- }
|
|
|
|
- $link = $shop['url'].$v['landing_site'];
|
|
|
|
- }
|
|
|
|
- if($link != '')
|
|
|
|
- {
|
|
|
|
- $authorid = $this->authorid($link,$shop['tweak']);
|
|
|
|
- }
|
|
|
|
- $thatDayOrder[] = array(
|
|
|
|
- 'order_id' => $v['order_number'],//订单号
|
|
|
|
- 'product_name' => $productNames,//产品标题
|
|
|
|
- 'purchased_on' => strtotime($created_at),//订单时间
|
|
|
|
- 'name' => $v['shipping_address']['name'],//收货人
|
|
|
|
- 'bill_to_name' => $v['billing_address']['name'],//账单人名称
|
|
|
|
- 'ship_to_name' => $v['shipping_address']['name'],//收货人名称
|
|
|
|
- 'shipping_address' => $shipping_address,
|
|
|
|
- 'billing_address' => $billing_address,
|
|
|
|
- 'country' => $v['shipping_address']['country_code'],//收货国家二字码
|
|
|
|
- 'region' => $v['shipping_address']['province_code'],//收货省/州
|
|
|
|
- 'city' => $v['shipping_address']['city'],//收货城市
|
|
|
|
- 'street' => $v['shipping_address']['address2'].' '.$v['shipping_address']['address1'],//收货地址
|
|
|
|
- 'telephone' => $v['shipping_address']['phone'],//收货人手机
|
|
|
|
- 'postcode' => $v['shipping_address']['zip'],//收货人邮政编码
|
|
|
|
- 'email' => $v['customer']['email'],//收货人邮箱
|
|
|
|
- 'global_currency_code' => $v['currency'],//币种
|
|
|
|
- 'base_grand_total' => $v['total_price'],//应收金额
|
|
|
|
- 'grand_total' => $v['total_price_set']['shop_money']['amount'],//币种支付金额
|
|
|
|
- 'isstatus' => 'processing',//$v['order_status'],//默认processing待发货状态
|
|
|
|
- 'isparameter' => implode(';',$parameters),
|
|
|
|
- 'sku' => $skus,
|
|
|
|
- 'order_quantity' => $quantity,
|
|
|
|
- 'order_comment' => $khbz.addslashes($v['note']),//客户备注
|
|
|
|
- 'pay' => $pay,
|
|
|
|
- 'paypal_num' => $paypal,
|
|
|
|
- 'insurance' => 0,
|
|
|
|
- 'paypal_protection_eligibility' => '',
|
|
|
|
- 'shippingmethod'=>'',
|
|
|
|
- 'link'=>$link,//产品链接
|
|
|
|
- 'shopify'=>$v['id'],
|
|
|
|
- 'authorid'=>$authorid,
|
|
|
|
- 'wjauthorid'=>$wjauthorid,
|
|
|
|
- 'sourcecontentid'=>$sourcecontentid
|
|
|
|
- );
|
|
|
|
|
|
+ // }
|
|
|
|
+ // $link = $shop['url'].$v['landing_site'];
|
|
|
|
+ // }
|
|
|
|
+ // if($link != '')
|
|
|
|
+ // {
|
|
|
|
+ // $authorid = $this->authorid($link,$shop['tweak']);
|
|
|
|
+ // }
|
|
|
|
+ // $thatDayOrder[] = array(
|
|
|
|
+ // 'order_id' => $v['order_number'],//订单号
|
|
|
|
+ // 'product_name' => $productNames,//产品标题
|
|
|
|
+ // 'purchased_on' => strtotime($created_at),//订单时间
|
|
|
|
+ // 'name' => $v['shipping_address']['name'],//收货人
|
|
|
|
+ // 'bill_to_name' => $v['billing_address']['name'],//账单人名称
|
|
|
|
+ // 'ship_to_name' => $v['shipping_address']['name'],//收货人名称
|
|
|
|
+ // 'shipping_address' => $shipping_address,
|
|
|
|
+ // 'billing_address' => $billing_address,
|
|
|
|
+ // 'country' => $v['shipping_address']['country_code'],//收货国家二字码
|
|
|
|
+ // 'region' => $v['shipping_address']['province_code'],//收货省/州
|
|
|
|
+ // 'city' => $v['shipping_address']['city'],//收货城市
|
|
|
|
+ // 'street' => $v['shipping_address']['address2'].' '.$v['shipping_address']['address1'],//收货地址
|
|
|
|
+ // 'telephone' => $v['shipping_address']['phone'],//收货人手机
|
|
|
|
+ // 'postcode' => $v['shipping_address']['zip'],//收货人邮政编码
|
|
|
|
+ // 'email' => $v['customer']['email'],//收货人邮箱
|
|
|
|
+ // 'global_currency_code' => $v['currency'],//币种
|
|
|
|
+ // 'base_grand_total' => $v['total_price'],//应收金额
|
|
|
|
+ // 'grand_total' => $v['total_price_set']['shop_money']['amount'],//币种支付金额
|
|
|
|
+ // 'isstatus' => 'processing',//$v['order_status'],//默认processing待发货状态
|
|
|
|
+ // 'isparameter' => implode(';',$parameters),
|
|
|
|
+ // 'sku' => $skus,
|
|
|
|
+ // 'order_quantity' => $quantity,
|
|
|
|
+ // 'order_comment' => $khbz.addslashes($v['note']),//客户备注
|
|
|
|
+ // 'pay' => $pay,
|
|
|
|
+ // 'paypal_num' => $paypal,
|
|
|
|
+ // 'insurance' => 0,
|
|
|
|
+ // 'paypal_protection_eligibility' => '',
|
|
|
|
+ // 'shippingmethod'=>'',
|
|
|
|
+ // 'link'=>$link,//产品链接
|
|
|
|
+ // 'shopify'=>$v['id'],
|
|
|
|
+ // 'authorid'=>$authorid,
|
|
|
|
+ // 'wjauthorid'=>$wjauthorid,
|
|
|
|
+ // 'sourcecontentid'=>$sourcecontentid
|
|
|
|
+ // );
|
|
|
|
+ // }
|
|
|
|
+ // return array_reverse($thatDayOrder);
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ $thatDayOrder = array();
|
|
|
|
+ if(isset($res['orders']))
|
|
|
|
+ {
|
|
|
|
+ foreach ($res['orders'] as $v)
|
|
|
|
+ {
|
|
|
|
+ $productNames = '';
|
|
|
|
+ $parameters = array();
|
|
|
|
+ $skus = '';
|
|
|
|
+ $quantity = '';
|
|
|
|
+ $thislink = '';
|
|
|
|
+ foreach($v['line_items'] as $key=>$val)
|
|
|
|
+ {
|
|
|
|
+ $productNames .= ($key > 0)?','.$val['name']:$val['name'];
|
|
|
|
+ $skus .= ($key > 0)?','.$val['sku']:$val['sku'];
|
|
|
|
+ $quantity .= floor($val['quantity']).';';
|
|
|
|
+ }
|
|
|
|
+ if(stripos($v['payment_gateway_names'][0],'shopify_') !== false)
|
|
|
|
+ {
|
|
|
|
+ $pay = 'shopifypay';
|
|
}
|
|
}
|
|
- return array_reverse($thatDayOrder);
|
|
|
|
|
|
+ else if(stripos($v['payment_gateway_names'][0],'paypal') !== false)
|
|
|
|
+ {
|
|
|
|
+ $pay = 'paypal_express';
|
|
|
|
+ }
|
|
|
|
+ else if(stripos($v['payment_gateway_names'][0],'gift_card') !== false)
|
|
|
|
+ {
|
|
|
|
+ $pay = 'gift_card';
|
|
|
|
+ }
|
|
|
|
+ else if(stripos($v['payment_gateway_names'][0],'shop_cash') !== false)
|
|
|
|
+ {
|
|
|
|
+ $pay = 'shop_cash';
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ $pay = $v['payment_gateway_names'][0];
|
|
|
|
+ }
|
|
|
|
+ $khbz = '';
|
|
|
|
+ if(!isset($v['shipping_address']['country_code']))
|
|
|
|
+ {
|
|
|
|
+ $v['shipping_address'] = $v['billing_address'];
|
|
|
|
+ $khbz = '客户自提订单; ';
|
|
|
|
+ }
|
|
|
|
+ $shipping_address = $v['shipping_address']['address2'].' '.$v['shipping_address']['address1'] . ',' . $v['shipping_address']['city'] . ',' . $v['shipping_address']['province'] . ',' . $v['shipping_address']['zip'] . ',' . $v['shipping_address']['country_code'] . ',' . $v['shipping_address']['phone'];
|
|
|
|
+ @$billing_address = $v['billing_address']['address2'].' '.$v['billing_address']['address1'] . ',' . $v['billing_address']['city'] . ',' . $v['billing_address']['province'] . ',' . $v['billing_address']['zip'] . ',' . $v['billing_address']['country_code'] . ',' . $v['billing_address']['phone'];
|
|
|
|
+ $created_at = explode('T',$v['created_at']);
|
|
|
|
+ $created_at_hi = explode('-',$created_at[1]);
|
|
|
|
+ $created_at = $created_at[0].' '.$created_at_hi[0];
|
|
|
|
+ $paypal = '';
|
|
|
|
+
|
|
|
|
+ // $d = $this->authorization($shop,$v['id']);
|
|
|
|
+ // if($d['g'] == 1)
|
|
|
|
+ // {
|
|
|
|
+ // $paypal = $d['d'];
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ $authorid = '';
|
|
|
|
+ $wjauthorid = '';
|
|
|
|
+ $sourcecontentid = '';
|
|
|
|
+ $link = '';
|
|
|
|
+ $thatDayOrder[] = array(
|
|
|
|
+ 'order_id' => $v['order_number'],//订单号
|
|
|
|
+ 'product_name' => $productNames,//产品标题
|
|
|
|
+ 'purchased_on' => strtotime($created_at),//订单时间
|
|
|
|
+ 'name' => $v['shipping_address']['name'],//收货人
|
|
|
|
+ 'bill_to_name' => $v['billing_address']['name'],//账单人名称
|
|
|
|
+ 'ship_to_name' => $v['shipping_address']['name'],//收货人名称
|
|
|
|
+ 'shipping_address' => $shipping_address,
|
|
|
|
+ 'billing_address' => $billing_address,
|
|
|
|
+ 'country' => $v['shipping_address']['country_code'],//收货国家二字码
|
|
|
|
+ 'region' => $v['shipping_address']['province_code'],//收货省/州
|
|
|
|
+ 'city' => $v['shipping_address']['city'],//收货城市
|
|
|
|
+ 'street' => $v['shipping_address']['address1']." ".$v['shipping_address']['address2'],//收货地址
|
|
|
|
+ 'telephone' => $v['shipping_address']['phone'],//收货人手机
|
|
|
|
+ 'postcode' => $v['shipping_address']['zip'],//收货人邮政编码
|
|
|
|
+ 'email' => $v['customer']['email'],//收货人邮箱
|
|
|
|
+ 'global_currency_code' => $v['currency'],//币种
|
|
|
|
+ 'base_grand_total' => $v['total_price'],//应收金额
|
|
|
|
+ 'grand_total' => $v['total_price_set']['shop_money']['amount'],//币种支付金额
|
|
|
|
+ 'isstatus' => 'processing',//$v['order_status'],//默认processing待发货状态
|
|
|
|
+ 'isparameter' => implode(';',$parameters),
|
|
|
|
+ 'sku' => $skus,
|
|
|
|
+ 'order_quantity' => $quantity,
|
|
|
|
+ 'order_comment' => $khbz.addslashes($v['note']),//客户备注
|
|
|
|
+ 'pay' => $pay,
|
|
|
|
+ 'paypal_num' => $paypal,
|
|
|
|
+ 'insurance' => 0,
|
|
|
|
+ 'paypal_protection_eligibility' => '',
|
|
|
|
+ 'shippingmethod'=>'',
|
|
|
|
+ 'link'=>$link,//产品链接
|
|
|
|
+ 'shopify'=>$v['id'],
|
|
|
|
+ 'authorid'=>$authorid,
|
|
|
|
+ 'wjauthorid'=>$wjauthorid,
|
|
|
|
+ 'sourcecontentid'=>$sourcecontentid
|
|
|
|
+ );
|
|
}
|
|
}
|
|
|
|
+ return array_reverse($thatDayOrder);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|