shish 3 éve
szülő
commit
7c3ec1e52d

+ 2 - 2
app-ghs/controllers/ShopAdminController.php

@@ -206,7 +206,7 @@ class ShopAdminController extends BaseController
         $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
         if ($join == 0 && $default == 0) {
-            util::fail('请在店操作');
+            util::fail('请在默认门店操作');
         }
 
         $shopAdmin = $this->shopAdmin;
@@ -270,7 +270,7 @@ class ShopAdminController extends BaseController
         $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
         if ($join == 0 && $default == 0) {
-            util::fail('请在店操作');
+            util::fail('请在默认门店操作');
         }
 
         $shopAdmin = $this->shopAdmin;

+ 7 - 7
app-ghs/controllers/ShopController.php

@@ -86,13 +86,13 @@ class ShopController extends BaseController
     //更新门店 ssh 2020.2.29
     public function actionUpdate()
     {
-        $shop = $this->shop;
-        $join = $shop->join ?? 0;
-        $default = $shop->default ?? 0;
-        if ($join == 0 && $default == 0) {
-            util::fail('请在总店操作');
-        }
         $data = Yii::$app->request->post();
+
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能修改');
+        }
+
         $data['sjId'] = $this->sjId;
         $id = $data['id'] ?? 0;
         $shop = ShopService::getById($id);
@@ -114,7 +114,7 @@ class ShopController extends BaseController
         $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
         if ($join == 0 && $default == 0) {
-            util::fail('请在店操作');
+            util::fail('请在默认门店操作');
         }
 
         $data = Yii::$app->request->post();