Kaynağa Gözat

测试达达跑腿查询帐户金额与bug修复

shizhongqi 7 ay önce
ebeveyn
işleme
dcf5638bf5

+ 4 - 4
common/components/delivery/platform/dada/Dada.php

@@ -36,10 +36,10 @@ class Dada
             $this->baseUrl = self::TEST_BASE_URL;
             $this->appKey = 'dadaf2279d901a5ba40';
             $this->appSecret = '828a03677a1c00a3a5b3c59209c4433d';
-            //$this->sourceId = '499021274';
         }
-        $shopId != 0 ? $this->shopNo = $shopId : '';
-        $sourceId != 0 ? $this->sourceId = $sourceId : '';
+
+        $this->shopNo = $shopId;
+        $this->sourceId = $sourceId;
     }
 
     public function setShopNo($shopNo)
@@ -67,7 +67,7 @@ class Dada
         if(isset($resp['code']) && $resp['code']==0){
             return [
                 'success' => true,
-                'balance' => $resp['deliverBalance'],
+                'balance' => $resp['result']['deliverBalance'] * 100, // 乘以100是把金额单位元改成分
                 'message' => '查询余额成功',
             ];
         }

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

@@ -51,7 +51,7 @@ class DispatchService
                         $this->adapters['shunfeng'] = new ShunfengAdapter($pt, $pt['shopId']);
                         break;
                     case 'dada':
-                        $this->adapters['dada'] = new DadaAdapter($pt['accessToken'], $pt['shopId']);
+                        $this->adapters['dada'] = new DadaAdapter($pt['accessToken'], $pt['shopId'], $pt['merchantId']);
                         //$this->adapters['dada']->setShopNo($pt['shopId']);
                         //$this->adapters['dada']->setSourceId($pt['merchantId']); // 用 merchanId 来保存 sourceId
                         break;
@@ -88,7 +88,7 @@ class DispatchService
                     $this->adapters['shunfeng'] = new ShunfengAdapter($authPlatform, $authPlatform['shopId']);
                     break;
                 case 'dada':
-                    $this->adapters['dada'] = new DadaAdapter($authPlatform['accessToken'], $authPlatform['shopId']);
+                    $this->adapters['dada'] = new DadaAdapter($authPlatform['accessToken'], $authPlatform['shopId'], $authPlatform['merchantId']);
                     //$this->adapters['dada']->setShopNo($authPlatform['shopId']);
                     //$this->adapters['dada']->setSourceId($authPlatform['merchantId']); // 用 merchanId 来保存 sourceId
                     break;

+ 1 - 1
common/components/delivery/services/adapter/DadaAdapter.php

@@ -700,7 +700,7 @@ class DadaAdapter extends Dada implements Adapter
 
         return [
             'code' => $resp['code'] ?? -1,
-            'msg' => $resp['msg'] ?? 'Unknown error',
+            'error' => $resp['msg'] ?? 'Unknown error',
             'data' => null
         ];
     }