Просмотр исходного кода

1.滴滴授权更新 2.滴滴根据订单号查找配送订单的查询条件bug修复

shizhongqi 7 месяцев назад
Родитель
Сommit
a8266426d7

+ 11 - 11
common/components/delivery/services/AuthService.php

@@ -72,22 +72,22 @@ Class AuthService{
 
     public function didiAuth($mainId, $shopId)
     {
-        // $shop = ShopClass::getById($shopId, false, 'id,lat,long');
-        // if(!$shop){
-        //     util::fail('门店不存在');
-        // }
-        // $lat = $shop['lat'];
-        // $lng = $shop['long'];
-        // if(empty($lat) || empty($lng)){
-        //     util::fail('门店经纬度不存在');
-        // }
+        $shop = ShopClass::getById($shopId, false, 'id,lat,long');
+        if(!$shop){
+            util::fail('门店不存在');
+        }
+        $lat = $shop['lat'];
+        $lng = $shop['long'];
+        if(empty($lat) || empty($lng)){
+            util::fail('门店经纬度不存在');
+        }
+
         $didiAuth = new \common\components\delivery\platform\didi\Auth();
-        $ret = $didiAuth->getAuthUrl($mainId, 110100, '', '');
+        $ret = $didiAuth->getAuthUrl($mainId, '', $lat, $lng);
         if(isset($ret['raw']) && $ret['raw']['code'] == 200){
             util::success(['url'=>$ret['raw']['data']['authUrl']]);
         }else{
             util::fail('获取授权地址失败');
         }
-
     }
 }

+ 4 - 2
common/components/delivery/services/DispatchService.php

@@ -187,7 +187,8 @@ class DispatchService
         // 查找批发配送订单
         $deliveryOrder = GhsDeliveryOrderClass::getByCondition([
             'deliveryId' => $deliveryId,
-            'ghsOrderId' => $orderId
+            'ghsOrderId' => $orderId,
+            'orderStatus' => ['not in', [-1, -2]],
         ], false, null, $fields);
 
         if ($deliveryOrder) {
@@ -197,7 +198,8 @@ class DispatchService
         // 查找零售配送订单
         $deliveryOrder =  HdDeliveryOrderClass::getByCondition([
             'deliveryId' => $deliveryId,
-            'hdOrderId' => $orderId
+            'hdOrderId' => $orderId,
+            'orderStatus' => ['not in', [-1, -2]],
         ], false, null, $fields);
 
         if ($deliveryOrder) {