فهرست منبع

Merge branch 'master' into dev

shish 2 ماه پیش
والد
کامیت
c855ad7551
1فایلهای تغییر یافته به همراه18 افزوده شده و 12 حذف شده
  1. 18 12
      app-mall/controllers/HdController.php

+ 18 - 12
app-mall/controllers/HdController.php

@@ -19,7 +19,7 @@ class HdController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
-        $hd = HdClass::getById($id,true);
+        $hd = HdClass::getById($id, true);
         if (empty($hd)) {
             util::fail('没有花店信息');
         }
@@ -35,7 +35,7 @@ class HdController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
-        $hd = HdClass::getById($id,true);
+        $hd = HdClass::getById($id, true);
         if (empty($hd)) {
             util::fail('没有花店信息');
         }
@@ -123,19 +123,25 @@ class HdController extends BaseController
         $delStatus = $get['delStatus'] ?? 0;
         $userId = $this->userId;
 
-        $mallUpgrading = getenv('MALL_UPGRADING') == false ? 0 : getenv('MALL_UPGRADING');
-        if ($mallUpgrading == 1) {
-            $allowShopAdminIdsStr = getenv('MALL_UPGRADE_ALLOW_USER_IDS') ?: '';
-            $allowShopAdminIds = !empty($allowShopAdminIdsStr) ? explode(',', $allowShopAdminIdsStr) : [];
-            if (!in_array($userId, $allowShopAdminIds)) {
-                util::fail('系统升级中,稍后再试,编号:'.$userId);
+        $respond = ['list' => []];
+        if ($userId > 0) {
+
+            $mallUpgrading = getenv('MALL_UPGRADING') == false ? 0 : getenv('MALL_UPGRADING');
+            if ($mallUpgrading == 1) {
+                $allowShopAdminIdsStr = getenv('MALL_UPGRADE_ALLOW_USER_IDS') ?: '';
+                $allowShopAdminIds = !empty($allowShopAdminIdsStr) ? explode(',', $allowShopAdminIdsStr) : [];
+                if (!in_array($userId, $allowShopAdminIds)) {
+                    util::fail('系统升级中,稍后再试,编号:' . $userId);
+                }
             }
+
+            $where = [];
+            $where['userId'] = $userId;
+            $where['delStatus'] = $delStatus;
+            $respond = HdClass::getHdList($where);
+
         }
 
-        $where = [];
-        $where['userId'] = $userId;
-        $where['delStatus'] = $delStatus;
-        $respond = HdClass::getHdList($where);
         util::success($respond);
     }