Explorar o código

聚水潭数据同步时间区间

dong025 hai 5 días
pai
achega
9c8b31ce4e
Modificáronse 2 ficheiros con 25 adicións e 22 borrados
  1. 23 20
      app/admin/command/JuShuiTan.php
  2. 2 2
      app/admin/service/JuShuiTanService.php

+ 23 - 20
app/admin/command/JuShuiTan.php

@@ -75,8 +75,10 @@ class JuShuiTan extends Command
                     'next_time_space'=>$jushuitan['next_time_space']
                 ];
                 Cache::set('jushuitan',$jushuitan);
-
+                
                 $list = $resquet['data'];
+                // dump($list);
+                // return;
                 $this->insertOrder($list);
                 //dump($resquet);
             } else {
@@ -121,8 +123,8 @@ class JuShuiTan extends Command
         //查询不到数据,就往下一个时间区间查询
         $todayTime = date("Y-m-d");
 
-        // $startTime_stamp = strtotime($todayTime . ' 00:00:00');
-        $startTime_stamp = strtotime($todayTime . ' 07:20:00');
+        $startTime_stamp = strtotime($todayTime . ' 00:00:00');
+        // $startTime_stamp = strtotime($todayTime . ' 07:20:00');
         $endTime_stamp=$startTime_stamp+$start_end_space_time;
         $pageNum=1;
 
@@ -143,21 +145,21 @@ class JuShuiTan extends Command
         $startTime = date('Y-m-d H:i:s', $jushuitan['startTime']);
         $endTime = date('Y-m-d H:i:s', $jushuitan['endTime']);
         $pageNum=(int)$jushuitan['pageNum'];
-        $body = '{
-            "startTime": "' . $startTime . '",
-            "endTime": "' . $endTime . '",
-            "dateQueryType": "DeliveryDate",
-            "coId": "14792222",
-            "uid": "21943091",
-            "upSendFailed": false,
-            "isExceptAddress": "Except",
-            "pageNum": '.$pageNum.',
-            "pageSize": 50,
-            "searchType": 1,
-            "orderStatus": [
-                "Sent"
-            ]
-        }';
+
+        $body = [
+            'startTime'     => $startTime,     // 动态时间变量
+            'endTime'       => $endTime,       // 动态时间变量
+            'dateQueryType' => 'DeliveryDate',
+            'coId'          => '14792222',
+            'uid'           => '21943091',
+            'upSendFailed'  => false,          // 布尔值保持原始类型
+            'isExceptAddress' => 'Except',
+            'pageNum'       => (int)$pageNum,  //当前页数
+            'pageSize'      => 50,//每页数据多少
+            'searchType'    => 1,       
+            'orderStatus'   => ['Sent'] 
+        ];
+        $body = json_encode($body);
         
         // "orderStatus": [
         //         "Sent"
@@ -199,14 +201,15 @@ class JuShuiTan extends Command
         });
         $shopDelivery_list=[];
         foreach ($order_list as $item) {
+            if (substr($item['trackNo'], 0, 1) === '@') continue;//同风速的,带@直接跳过
             // dump($item['shopId'], '店铺id');
             // 防止重复记录,订单号+快递单号
             $goods_id = $item['disInnerOrderGoodsViewList'][0]['shopIid'];
 
             $oid = $item['oid'];
             $sku_id=$item['disInnerOrderGoodsViewList'][0]['shopSkuId'];
-            $waybill_no = ltrim($item['trackNo'], '@');
-            // $waybill_no=$item['trackNo'];
+            // $waybill_no = ltrim($item['trackNo'], '@');
+            $waybill_no=$item['trackNo'];
             if (empty($waybill_no)) continue;
             $add_status = JuShuiTanService::prevent_duplicate_additions($sku_id, $waybill_no);
             if ($add_status) continue;

+ 2 - 2
app/admin/service/JuShuiTanService.php

@@ -181,8 +181,8 @@ class JuShuiTanService {
             'ship_date'     => $item['consign_time'],
             'incubator'   => $getPackSpecsFee['pack_specs_type'],
             'insulation_money'   => $getPackSpecsFee['surcharge_money'],
-            'labor_cost_money'   => $getPackSpecsFee['data']['labor_cost_money']
-            
+            'labor_cost_money'   => $getPackSpecsFee['data']['labor_cost_money'],
+            'order_status'   => $item['order_status'],
            
             
         ];