ソースを参照

请在总店添加

shish 3 年 前
コミット
2e841f1cd3
1 ファイル変更7 行追加3 行削除
  1. 7 3
      app-ghs/controllers/ShopController.php

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

@@ -88,6 +88,11 @@ class ShopController extends BaseController
     {
         $data = Yii::$app->request->post();
 
+        $shop = $this->shop;
+        if (isset($shop->default) == false || $shop->default != 1) {
+            util::fail('请在总店修改');
+        }
+
         $shopAdmin = $this->shopAdmin;
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('超管才能修改');
@@ -111,10 +116,9 @@ class ShopController extends BaseController
     public function actionAdd()
     {
         $shop = $this->shop;
-        $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
-        if ($join == 0 && $default == 0) {
-            util::fail('请在总店操作');
+        if ($default == 0) {
+            util::fail('请在总店添加');
         }
 
         $data = Yii::$app->request->post();