Browse Source

权限控制

shish 4 years ago
parent
commit
38338b46dc
1 changed files with 14 additions and 0 deletions
  1. 14 0
      app-ghs/controllers/SalaryController.php

+ 14 - 0
app-ghs/controllers/SalaryController.php

@@ -15,6 +15,13 @@ class SalaryController extends BaseController
 
     public function actionList()
     {
+
+        $staff = $this->shopAdmin;
+        $founder = $staff->founder ?? 2;
+        if ($founder != 1) {
+            util::fail('没有权限查看哦');
+        }
+
         $where = [];
         $where['mainId'] = $this->mainId;
         $list = SalaryClass::getSalaryList($where);
@@ -24,6 +31,13 @@ class SalaryController extends BaseController
     //发工资 ssh 2022710
     public function actionAddSalary()
     {
+
+        $staff = $this->shopAdmin;
+        $founder = $staff->founder ?? 2;
+        if ($founder != 1) {
+            util::fail('没有权限操作哦');
+        }
+
         $post = Yii::$app->request->post();
         $data = $post['data'] ?? '';
         if (empty($data)) {