Jelajahi Sumber

加减余额、发红包、作废红包、设置会员,只有超级管理员(指founder=2)才能操作

shizhongqi 3 bulan lalu
induk
melakukan
48666a4245

+ 4 - 0
app-hd/controllers/CustomController.php

@@ -184,6 +184,10 @@ class CustomController extends BaseController
         if ($custom->shopId != $this->shopId) {
             util::fial('无权限修改');
         }
+        if (isset($this->shopAdmin->founder) == false || $this->shopAdmin->founder != 2) {
+            util::fail('管理员才能操作');
+        }
+
         $custom->vip = $vip;
         $custom->save();
 

+ 3 - 0
app-hd/controllers/DeductController.php

@@ -40,6 +40,9 @@ class DeductController extends BaseController
         }
 
         $staff = $this->shopAdmin;
+        if (isset($this->shopAdmin->founder) == false || $this->shopAdmin->founder != 2) {
+            util::fail('管理员才能操作');
+        }
         if ($staff->finance == 0) {
             util::fail('没有财务权限');
         }

+ 8 - 0
app-hd/controllers/HbController.php

@@ -115,6 +115,10 @@ class HbController extends BaseController
         $adminId = $this->shopAdminId;
         util::checkRepeatCommit($adminId, 5);
 
+        if (isset($this->shopAdmin->founder) == false || $this->shopAdmin->founder != 2) {
+            util::fail('管理员才能操作');
+        }
+
         $duration = (int)$form->days;
         $count = $post['count'] ?? 1;
         $effectiveDate = $post['effectiveDate'];
@@ -180,6 +184,10 @@ class HbController extends BaseController
             util::fail('不是本门店的红包');
         }
 
+        if (isset($this->shopAdmin->founder) == false || $this->shopAdmin->founder != 2) {
+            util::fail('管理员才能操作');
+        }
+
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();