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

xhShansAuthToken 变更为 xhShansAuthToken

shizhongqi 9 месяцев назад
Родитель
Сommit
6b43085c47

+ 23 - 1
app-ghs/controllers/DeliveryController.php

@@ -24,8 +24,30 @@ class DeliveryController extends BaseController
 
     public function actionList()
     {
+        $platformList = [];
+        $platformLogos = [
+            'data' => '📦',
+            'shunfeng' => '🚚',
+            'meituan' => '🍱' ,
+            'fengniao' => '🍜',
+            'huolala' => '🚛',
+            'shansong' => '⚡',
+            'didi' => '🚗',
+			'uu' => '🛵'
+        ];
         $mainId = $this->mainId;
-        DeliveryAuthTokenClass::getAllByCondition(['mainId'=>$mainId]);
+        $allDeliveries = DeliveryAuthTokenClass::getAllByCondition(['mainId'=>$mainId]);
+        foreach($allDeliveries as $d){
+            $item = [
+                'id'=>$d['platform'],
+                'logo'=>$platformLogos[$d['platform']],
+                'is_authorized' => true,
+                'balance' => 0,
+                'access_type' => 'oauth'
+            ];
+            $platformList = $item;
+        }
+        util::success(['platformList'=>$platformList]);
 //        [
 //            { id: 'dada', name: '达达', logo: '📦', is_authorized: true, balance: 178.0, access_type: 'oauth' },
 //            { id: 'sf-tongcheng', name: '顺丰同城', logo: '🚚', is_authorized: true, balance: 174.0, access_type: 'oauth' },

+ 2 - 2
biz-ghs/express/models/ShansAuthToken.php → biz-ghs/express/models/DeliveryAuthToken.php

@@ -4,10 +4,10 @@
 namespace bizGhs\express\models;
 use bizGhs\base\models\Base;
 
-class ShansAuthToken extends Base
+class DeliveryAuthToken extends Base
 {
     public static function tableName()
     {
-        return 'xhShansAuthToken';
+        return 'xhDeliveryAuthToken';
     }
 }