瀏覽代碼

查看财务权限

shish 3 年之前
父節點
當前提交
274f890c42
共有 2 個文件被更改,包括 12 次插入6 次删除
  1. 5 3
      app-ghs/controllers/StatController.php
  2. 7 3
      app-ghs/controllers/StatKdController.php

+ 5 - 3
app-ghs/controllers/StatController.php

@@ -5,6 +5,7 @@ namespace ghs\controllers;
 use bizGhs\order\classes\PurchaseOrderClass;
 use bizGhs\order\classes\StockWastageOrderClass;
 use bizGhs\order\classes\StockWastageOrderItemClass;
+use bizGhs\shop\classes\ShopAdminClass;
 use bizGhs\stat\classes\StatSaleClass;
 use common\components\arrayUtil;
 use common\components\imgUtil;
@@ -68,9 +69,10 @@ class StatController extends BaseController
         ini_set('memory_limit', '2045M');
         set_time_limit(0);
 
-        $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
-            util::fail('超管才能查看');
+        //查看财务的权限
+        $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
+        if ($lookMoney == 0) {
+            util::fail('没有权限查看');
         }
 
         //惠雅鲜花员工不能看利润表

+ 7 - 3
app-ghs/controllers/StatKdController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use bizGhs\shop\classes\ShopAdminClass;
 use bizGhs\stat\classes\StatKdClass;
 use common\components\util;
 use Yii;
@@ -12,10 +13,13 @@ class StatKdController extends BaseController
     //各渠道收入 ssh 20220711
     public function actionProfile()
     {
-        $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
-            util::fail('超管才能查看');
+
+        //查看财务的权限
+        $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
+        if ($lookMoney == 0) {
+            util::fail('没有权限查看');
         }
+
         //惠雅鲜花员工不能看收入情况
         $shopAdmin = $this->shopAdmin;
         $adminId = $shopAdmin->adminId ?? 0;