Explorar o código

云打印设置

shish %!s(int64=5) %!d(string=hai) anos
pai
achega
8e49646f04
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      app-ghs/controllers/ShopExtController.php

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

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\admin\classes\AdminRoleClass;
 use biz\shop\classes\ShopExtClass;
 use common\components\printUtil;
 use common\components\util;
@@ -15,6 +16,15 @@ class ShopExtController extends BaseController
     //添加打印机 shish 20210712
     public function actionAddPrint()
     {
+
+        $shopAdmin = $this->shopAdmin;
+        $roleId = $shopAdmin['roleId'] ?? 0;
+        $role = AdminRoleClass::getById($roleId);
+        $roleName = $role['roleName'] ?? '';
+        if ($roleName == '员工') {
+            util::fail('没有权限操作哦');
+        }
+
         $shopId = $this->shopId;
         $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
         $get = Yii::$app->request->get();