Browse Source

修改功能

shish 4 năm trước cách đây
mục cha
commit
7999409cf9

+ 9 - 5
app-ghs/controllers/ProductController.php

@@ -484,17 +484,21 @@ class ProductController extends BaseController
 
 
     public function actionUpdate()
     public function actionUpdate()
     {
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $shop = $this->shop;
         $shop = $this->shop;
         $join = $shop->join ?? 0;
         $join = $shop->join ?? 0;
         $default = $shop->default ?? 0;
         $default = $shop->default ?? 0;
         if ($join == 0 && $default == 0) {
         if ($join == 0 && $default == 0) {
-            //util::fail('请在首店操作');
+            //因为盘点不能将花材盘成0,所以这边放出入口允许创始人在分店修改分店的库存
+            if ($shopAdmin->founder != 2) {
+                util::fail('请在首店操作');
+            }
         }
         }
 
 
-        $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
-            util::fail('超管才能操作');
-        }
         $post = Yii::$app->request->post();
         $post = Yii::$app->request->post();
         $post['adminId'] = $this->adminId;
         $post['adminId'] = $this->adminId;
         $post['staffName'] = $this->shopAdmin->name;
         $post['staffName'] = $this->shopAdmin->name;