shish 5 лет назад
Родитель
Сommit
20eba45c52
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      app-ghs/controllers/PurchaseOrderController.php

+ 9 - 0
app-ghs/controllers/PurchaseOrderController.php

@@ -2,6 +2,7 @@
 
 namespace ghs\controllers;
 
+use biz\admin\classes\AdminRoleClass;
 use biz\ghs\classes\GhsClass;
 use bizGhs\order\classes\PurchaseOrderClass;
 use bizGhs\product\classes\ProductClass;
@@ -19,6 +20,14 @@ class PurchaseOrderController extends BaseController
         $post['shopId'] = $this->shopId;
         $post['adminId'] = $this->adminId;
 
+        $shopAdmin = $this->shopAdmin;
+        $roleId = $shopAdmin['roleId'] ?? 0;
+        $role = AdminRoleClass::getById($roleId);
+        $roleName = $role['roleName'] ?? '';
+        if ($roleName == '店长') {
+            util::fail('员工没有采购权限');
+        }
+
         $ghsItemInfo = $post['itemInfo'] ?? '';
         if (empty($ghsItemInfo)) {
             util::fail('请选择花材');