shish před 5 roky
rodič
revize
6431c55ca6

+ 18 - 0
app-ghs/controllers/ShopAdminController.php

@@ -20,6 +20,12 @@ class ShopAdminController extends BaseController
     public function actionPrepareBind()
     {
         $post = Yii::$app->request->post();
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         $roleId = isset($post['roleId']) ? $post['roleId'] : 0;
         $role = AdminRoleService::getById($roleId);
         if (empty($role) || isset($role['merchantId']) != $this->sjId) {
@@ -103,6 +109,12 @@ class ShopAdminController extends BaseController
     {
         $post = Yii::$app->request->post();
         $id = $post['id'] ?? 0;
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         if (empty($id)) {
             util::fail('请选择员工');
         }
@@ -138,6 +150,12 @@ class ShopAdminController extends BaseController
     public function actionDelete()
     {
         $id = Yii::$app->request->get('id');
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         $relation = ShopAdminClass::getById($id, true);
         \biz\shop\classes\ShopAdminClass::deleteShopAdmin($relation, $this->shopAdminId, $this->shopId);
         util::complete();

+ 1 - 1
app-ghs/controllers/ShopController.php

@@ -208,7 +208,7 @@ class ShopController extends BaseController
         $shopAdmin = $this->shopAdmin;
         $shopId = $shopAdmin['shopId'];
         if ($shopAdmin['super'] != 1) {
-            util::fail('您没有权限修改');
+            util::fail('超管才能操作');
         }
         ShopClass::updateById($shopId, ['cashAccount' => $cashAccount, 'cashName' => $cashName]);
         util::complete();

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

@@ -14,7 +14,7 @@ class ShopExpressController extends BaseController
     public function actionDadaInfo()
     {
         $sjId = SjExpressClass::getSourceId($this->sjId);
-        $shopNo = ShopExpressClass::getShopNo($this->sjId,$this->shopId);
+        $shopNo = ShopExpressClass::getShopNo($this->sjId, $this->shopId);
         $respond = ['sjId' => $sjId, 'shopNo' => $shopNo];
         util::success($respond);
     }
@@ -25,14 +25,18 @@ class ShopExpressController extends BaseController
         $get = Yii::$app->request->get();
         $sourceId = $get['sjId'] ?? '';
         $shopNo = $get['shopNo'] ?? '';
-        if(empty($sourceId) ){
+        if (empty($sourceId)) {
             util::fail("请输入商户ID");
         }
-        if(empty($shopNo) ){
+        if (empty($shopNo)) {
             util::fail("请输入门店ID");
         }
-        SjExpressClass::updateSourceId($this->sjId,$sourceId);
-        ShopExpressClass::updateShopNo($this->sjId,$this->shopId,$shopNo);
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+        SjExpressClass::updateSourceId($this->sjId, $sourceId);
+        ShopExpressClass::updateShopNo($this->sjId, $this->shopId, $shopNo);
         util::complete();
     }
 

+ 18 - 2
app-hd/controllers/ShopAdminController.php

@@ -8,10 +8,8 @@ use bizHd\admin\services\AdminRoleService;
 use bizHd\admin\services\ShopAdminService;
 use bizHd\wx\services\WxOpenService;
 use common\components\imgUtil;
-use common\components\jwt;
 use common\components\util;
 use Yii;
-use yii\web\Controller;
 
 class ShopAdminController extends BaseController
 {
@@ -23,6 +21,12 @@ class ShopAdminController extends BaseController
     {
         $post = Yii::$app->request->post();
         $roleId = isset($post['roleId']) ? $post['roleId'] : 0;
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         $role = AdminRoleService::getById($roleId);
         if (empty($role) || isset($role['merchantId']) != $this->sjId) {
             util::fail('请选择角色!');
@@ -95,6 +99,12 @@ class ShopAdminController extends BaseController
     {
         $post = Yii::$app->request->post();
         $id = $post['id'] ?? 0;
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         if (empty($id)) {
             util::fail('请选择员工');
         }
@@ -130,6 +140,12 @@ class ShopAdminController extends BaseController
     public function actionDelete()
     {
         $id = Yii::$app->request->get('id');
+
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+
         $relation = ShopAdminClass::getById($id, true);
         \biz\shop\classes\ShopAdminClass::deleteShopAdmin($relation, $this->shopAdminId, $this->shopId);
         util::complete();

+ 1 - 1
app-hd/controllers/ShopController.php

@@ -167,7 +167,7 @@ class ShopController extends BaseController
         $shopAdmin = $this->shopAdmin;
         $shopId = $shopAdmin['shopId'];
         if ($shopAdmin['super'] != 1) {
-            util::fail('您没有权限修改');
+            util::fail('超管才能操作');
         }
         ShopClass::updateById($shopId, ['cashAccount' => $cashAccount, 'cashName' => $cashName]);
         util::complete();

+ 9 - 5
app-hd/controllers/ShopExpressController.php

@@ -14,7 +14,7 @@ class ShopExpressController extends BaseController
     public function actionDadaInfo()
     {
         $sjId = SjExpressClass::getSourceId($this->sjId);
-        $shopNo = ShopExpressClass::getShopNo($this->sjId,$this->shopId);
+        $shopNo = ShopExpressClass::getShopNo($this->sjId, $this->shopId);
         $respond = ['sjId' => $sjId, 'shopNo' => $shopNo];
         util::success($respond);
     }
@@ -25,14 +25,18 @@ class ShopExpressController extends BaseController
         $get = Yii::$app->request->get();
         $sourceId = $get['sjId'] ?? '';
         $shopNo = $get['shopNo'] ?? '';
-        if(empty($sourceId) ){
+        if (empty($sourceId)) {
             util::fail("请输入商户ID");
         }
-        if(empty($shopNo) ){
+        if (empty($shopNo)) {
             util::fail("请输入门店ID");
         }
-        SjExpressClass::updateSourceId($this->sjId,$sourceId);
-        ShopExpressClass::updateShopNo($this->sjId,$this->shopId,$shopNo);
+        $shopAdmin = $this->shopAdmin;
+        if ($shopAdmin['super'] != 1) {
+            util::fail('超管才能操作');
+        }
+        SjExpressClass::updateSourceId($this->sjId, $sourceId);
+        ShopExpressClass::updateShopNo($this->sjId, $this->shopId, $shopNo);
         util::complete();
     }