shish 3 роки тому
батько
коміт
f3223d6db8

+ 26 - 7
app-ghs/controllers/ProductController.php

@@ -495,7 +495,7 @@ class ProductController extends BaseController
         $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
         if ($join == 0 && $default == 0) {
-            util::fail('请在总店修改');
+            util::fail('当前是直营分店,请切回总店修改');
         }
 
         $shopAdmin = $this->shopAdmin;
@@ -679,6 +679,11 @@ class ProductController extends BaseController
     public function actionBatchChangeMore()
     {
         $shop = $this->shop;
+        $default = $shop->default ?? 0;
+        if ($default == 0) {
+            util::fail('当前是直营分店,请切回总店修改');
+        }
+
         $shopAdmin = $this->shopAdmin;
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('超管才能操作');
@@ -735,6 +740,11 @@ class ProductController extends BaseController
     public function actionBatchChangeAddPrice()
     {
         $shop = $this->shop;
+        $join = $shop->join ?? 0;
+        $default = $shop->default ?? 0;
+        if ($join == 0 && $default == 0) {
+            util::fail('当前是直营分店,请切回总店操作');
+        }
 
         $shopAdmin = $this->shopAdmin;
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
@@ -912,6 +922,13 @@ class ProductController extends BaseController
     public function actionAdd()
     {
         $post = Yii::$app->request->post();
+        $shop = $this->shop;
+        $join = $shop->join ?? 0;
+        $default = $shop->default ?? 0;
+        if ($join == 0 && $default == 0) {
+            util::fail('当前是直营分店,请切回总店添加花材');
+        }
+
         $shopAdmin = $this->shopAdmin;
         if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
             util::fail('管理员才能添加花材');
@@ -958,12 +975,6 @@ class ProductController extends BaseController
             util::fail('管理员才能添加花材');
         }
 
-        $shop = $this->shop;
-        $default = $shop->default ?? 0;
-        if ($default != 1) {
-            util::fail('请在总店添加');
-        }
-
         $post['sjId'] = $this->sjId;
         $post['adminId'] = $this->adminId;
         $post['mainId'] = $this->mainId;
@@ -1023,6 +1034,14 @@ class ProductController extends BaseController
     public function actionBatchModifyClass()
     {
         $post = Yii::$app->request->post();
+
+        $shop = $this->shop;
+        $join = $shop->join ?? 0;
+        $default = $shop->default ?? 0;
+        if ($join == 0 && $default == 0) {
+            util::fail('当前是直营分店,请切回总店操作');
+        }
+
         $classId = $post['classId'] ?? 0;
         $class = ItemClassClass::getById($classId, true);
         if (empty($class) || $class->mainId != $this->mainId) {

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

@@ -240,7 +240,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;

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

@@ -90,7 +90,7 @@ class ShopController extends BaseController
 
         $shop = $this->shop;
         if (isset($shop->default) == false || $shop->default != 1) {
-            util::fail('请在总店修改');
+            util::fail('当前是直营分店,请切回总店修改');
         }
 
         $shopAdmin = $this->shopAdmin;
@@ -118,7 +118,7 @@ class ShopController extends BaseController
         $shop = $this->shop;
         $default = $shop->default ?? 0;
         if ($default == 0) {
-            util::fail('请在总店添加');
+            util::fail('当前是直营分店,请切回总店添加');
         }
 
         $data = Yii::$app->request->post();