فهرست منبع

提交数据信息

lvhao 2 روز پیش
والد
کامیت
ef7d23c281
1فایلهای تغییر یافته به همراه89 افزوده شده و 1 حذف شده
  1. 89 1
      core/CoreApp/controllers/Aatest.php

+ 89 - 1
core/CoreApp/controllers/Aatest.php

@@ -92,7 +92,7 @@ class Aatest extends Start_Controller {
     //定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
     {  
-		$this->_cbtxcel();
+		$this->_tbuni();
 		die;
 		//测试 erp现在还在用的数据
 		//
@@ -279,6 +279,94 @@ class Aatest extends Start_Controller {
 			exit('No direct script access allowed');
 		}
     }
+	private  function _tbuni(){
+		$dataorder = array();$datashop = array();$dataex = array();$datack = array();
+		//  订单加入键值-k 
+		$fdata = $this->fullorder->find_all("express = 81 and librarytime >= 1761580800 and librarytime <= 1764172800 and state = 207");//,'source,id,orderinfo,waybill,shop,express,type,msg,bname,state,client,name,phone,zipcode,address,email,shopify'
+	
+		//*  订单加入键值-j 
+		//*  店铺加入键值-j 
+		$fshop = $this->shop->find_all('1=1');
+		foreach ($fshop as $v)
+		{
+			$datashop[$v['id']] = $v;
+		}
+		//*  店铺加入键值-k 
+		//*  快递加入键值-j 
+		$fex = $this->express->find_all('1=1');
+		foreach ($fex as $v) 
+		{
+			$dataex[$v['id']] = $v;
+		}
+		//*  快递加入键值-k 
+		//*  仓库加入键值-k 
+		$fwh = $this->warehouse->find_all('1=1');
+		foreach ($fwh as $v) 
+		{
+			$datack[$v['id']] = $v;
+		}
+		//*  仓库加入键值-j 
+		$i = 0;$j = 0;$ed = array();
+		echo "<pre>";
+		foreach ($fdata as $key=>$value)
+		{
+			if($value['source'] == 1)
+			{
+				$this->fullorder->save(array('dlz'=>3,'state'=>216),$value['id']);
+			}
+			else
+			{
+				if($value['shop'] == 5){
+					$ddh = $value['orderinfo'];
+				}else{
+					$ddh = substr($value['orderinfo'],1);
+				}
+			    
+			    $ydh = $value['waybill'];
+			    $xg = $value;//此订单数据
+			    $shop = $datashop[$xg['shop']];//此订单店铺
+			    $ex = $dataex[$xg['express']];//此订单快递
+			    $warehouse = $datack[$xg['type']];//此订单仓库
+				$shopifyid = $value['shopify'];
+				if($xg['shop'] < 7)
+				{
+		            $xg['iscode'] = $ex['title'];
+		            $xg['url'] = $shop['shopname'];
+				    @$fs = $this->api->get_paypal($xg);
+					$this->afspaypal->insert(array('number'=>$xg['number'],'cs'=>$fs));
+				}
+				$ms = $this->message->find_all("express like '%,".$xg['express'].",%'");
+				if(!isset($ms[0]))
+				{
+					$ms = $this->message->read(2);
+				}
+				else
+				{
+					$ms = $ms[0];
+				}
+				$shopname = $shop['brandname'];  //店铺名
+				$buyername = $xg['bname'];   //Bill Name
+				$email_call = $shop['shopid']; //发货人邮箱;
+				$phone = $shop['shopphone'];   //发货人电话
+				$track_type = $ex['title'];   //快递名称
+				$service = $ex['title'];   //快递追踪名称
+				$track_link = $ex['url'];   //快递查询网址
+				$logistics_number = $ydh;    //运单号
+				$t= array('%buyername%','%email_call%','%track_type%','%service%','%track_link%','%logistics_number%','%shop%','%phone%','%jtime%');
+				$h= array($buyername,$email_call,$track_type,$service,$track_link,$logistics_number,$shopname,$phone,$ex['yjtime']);
+				$remark = str_replace($t,$h,$ms['content']);
+				var_dump($xg['number']);
+
+			    // @$gx = $this->api->get_gx($ddh,$ydh,$xg,$shop,$ex,$remark,$shopifyid);
+				
+				// if(!isset($gx['res']))
+				// {
+				// 	continue;
+				// }
+			    // $this->fullorder->save(array('dlz'=>$gx['res'],'state'=>$gx['state']),$value['id']);
+			}
+		}
+	}
 	private function _cbtxcel(){
 		$list = $this->db->from("fullordertt")->where("source` = 2 AND `express` = 83 AND `librarytime` >= 1763730574 AND `librarytime` <= 1763762974")->get()->result_array();