Browse Source

提交数据

lvhao 2 days ago
parent
commit
00b623af0e

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

@@ -84,6 +84,7 @@ class Aatest extends Start_Controller {
 		$this->load->_model("Model_zzjobs","zzjobs");
 		$this->load->_model("Model_logic_goods_replace","logic_goods_replace");
 		$this->load->_model("Model_apittv1","apittv1");
+		$this->load->_model("Model_express_tt","express_tt");
     }
 	
 
@@ -91,11 +92,18 @@ class Aatest extends Start_Controller {
     public function _remap($arg,$arg_array)
     {  
 		$info = $this->logic_order->getInfo("number = '".$arg_array[0]."'");
+		$res = $this->express_tt->get_data($info,'FBT');
+		echo "<pre>";
+		print_r($res);
+
+		die;
+		$info = $this->logic_order->getInfo("number = '".$arg_array[0]."'");
+
 		$extra_text = json_decode($info['extra_text'],true);
 		$packages = $extra_text['packages'];
 		$package_id = $packages[0]['id'];
 		$shop = $this->shop->read($info['shop']);
-        //$r = $this->apittv1->downloadLabel($package_id,$shop,$info);
+        //$r = $this->apitt->downloadLabel($package_id,$shop,$info);
 		$r = $this->apittv1->ShipByTiktok($package_id,$shop,$info);
 		var_dump($r);
 		die;

+ 1 - 1
core/CoreApp/models/Model_apitt.php

@@ -475,7 +475,7 @@ function __construct(){
 		$url .= $link.'&sign='.$sign;
 		$headers = array('Content-Type: application/json','x-tts-access-token:'.$shop['token']);
 		$res = $this->su_curl($post,$url,$headers);
-		$this->logic_ding->sendToDing($info['number']."获取通过TT快递服务信息".$res);
+		$this->logic_ding->sendToDing($info['number']."TT的API的发货请求".$res);
 		$res = json_decode($res,true);
 		return $res;
 	}

+ 16 - 12
core/CoreApp/models/Model_express_tt.php

@@ -130,6 +130,22 @@ class Model_express_tt extends Lin_Model {
             $extra_text = json_decode($extra_text,true);
         }
         $packages = $extra_text['packages'];
+        $packageid = $packages[0]['id'];
+        if(!isset($extra_text['is_send'])){
+            $rr1 = $this->apitt->ShipByTiktok($packageid,$shop_info[0],$info);
+            if(($rr1['code'] == 0) && ($rr1['message'] == 'Success')){
+
+            }else{
+                $extra_text['is_send'] = 1;
+                $this->db->update('fullordertt', [
+                    'extra_text' => json_encode($extra_text,JSON_UNESCAPED_UNICODE)
+                ], ['id' => $info['id']]) ;
+                return [
+                    'x'=>0,
+                    'Description'=>$rr1['message'],  
+                ];
+            }
+        }
         // if(!isset($extra_text['server_info'])){
         //     $rr1 = $this->getExpressCompany($info,$shop_info[0]);
         //     if($rr1['x'] == 0){
@@ -154,18 +170,6 @@ class Model_express_tt extends Lin_Model {
         //     }
         // }
 
-        // if(!isset($extra_text['label_info'])){
-        //     $rr2 = $this->createExpressLabel($info,$shop_info[0]);
-        //     if($rr2['x'] == 0){
-        //         return $rr2;
-        //     }
-        //     $info = $rr2['data'];
-        //     if(is_string($info['extra_text'])){
-        //         $info['extra_text'] = json_decode($info['extra_text'],true);
-        //     }
-        // }
-        
-        $packageid = $packages[0]['id'];
         $rr = $this->apitt->downloadLabel($packageid,$shop_info[0],$info);
         if($rr['code']!=0){
             return [