Kaynağa Gözat

限制非超管动作

shish 4 yıl önce
ebeveyn
işleme
83556e399f
1 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 10 0
      app-ghs/controllers/ProductController.php

+ 10 - 0
app-ghs/controllers/ProductController.php

@@ -310,6 +310,11 @@ class ProductController extends BaseController
     //批量修改更多,包括排序、重量和保质期 shish 20211211
     public function actionBatchChangeMore()
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $addData = Yii::$app->request->post('addData', '');
         if (empty($addData)) {
             util::fail('没有花材');
@@ -338,6 +343,11 @@ class ProductController extends BaseController
     //批量修改加价 shish 20211211
     public function actionBatchChangeAddPrice()
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $addData = Yii::$app->request->post('addData', '');
         if (empty($addData)) {
             util::fail('没有花材');