lvhao 3 months ago
parent
commit
78a2054b6a
1 changed files with 4 additions and 86 deletions
  1. 4 86
      core/CoreApp/controllers/Aatest.php

+ 4 - 86
core/CoreApp/controllers/Aatest.php

@@ -105,94 +105,12 @@ class Aatest extends Start_Controller {
 		//$this->_print();
     }
 	public function linshi(){
-		$dataorder = array();$datashop = array();$dataex = array();$datack = array();
+		
 		//  订单加入键值-k 
-		$fdata  = $this->fullorder->find_all(" source != 1  and  state  = 207  and  express  = 71  and  librarytime >=  1744473600   and  librarytime < 1746892800" ,"*",null,0,1);
+		$fdata  = $this->fullorder->find_all(" source != 1  and  state  = 207  and  express  = 72  and  librarytime >=  1744473600   and  librarytime < 1746892800" ,"*",null,0,1);
 		echo "<pre>";
-	    	var_dump($fdata[0]['number']);
-	        var_dump($fdata[0]['waybill']);
-
-
-			$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();
-			foreach ($fdata as $key=>$value)
-			{
-				if($value['source'] == 1)
-				{
-					$this->fullorder->save(array('dlz'=>3,'state'=>216),$value['id']);
-				}
-				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']);
-					// $this->logic_ding->sendToDing("erp同步独立站的信息ddh".json_encode($ddh));
-					// $this->logic_ding->sendToDing("erp同步独立站的信息ydh".json_encode($ydh));
-					// $this->logic_ding->sendToDing("erp同步独立站的信息xg".json_encode($xg));
-					// $this->logic_ding->sendToDing("erp同步独立站的信息shop".json_encode($shop));
-					// $this->logic_ding->sendToDing("erp同步独立站的信息ex".json_encode($ex));
-					// $this->logic_ding->sendToDing("erp同步独立站的信息remark".json_encode($remark));
-	
-					@$gx = $this->api->get_gx($ddh,$ydh,$xg,$shop,$ex,$remark,$shopifyid);
-					//$this->logic_ding->sendToDing("erp同步独立站的信息".json_encode($gx));
-					if(!isset($gx['res']))
-					{
-						continue;
-					}
-					$this->fullorder->save(array('dlz'=>$gx['res'],'state'=>$gx['state']),$value['id']);
-				}
-				//sleep(4);
-			}
+		print_r(count($fdata));
+	    	
 	}
 	public function _print(){
 		$this->_Template('aaadayin',$this->data);