Эх сурвалжийг харах

超管才能开已收款订单

shish 5 жил өмнө
parent
commit
7ba10c8196

+ 9 - 1
app-ghs/controllers/OrderController.php

@@ -101,10 +101,18 @@ class OrderController extends BaseController
         $post['expressId'] = $post['expressId'] ?? 0;
         $post['sendCost'] = $post['sendCost'] ?? '0.00';
         //$post['payWay'] = dict::getDict('payWay', 'wxPay');
+        $clearType = $post['clearType'] ?? OrderClass::CLEAR_DEBT;
+
+        //员工不能开已收款订单
+        if ($clearType == OrderClass::CLEAR_HAS_GATHERING) {
+            $shopAdmin = $this->shopAdmin;
+            if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+                util::fail('没有权限');
+            }
+        }
 
         //PC端开单
         if (isset($post['clearType'])) {
-            $clearType = $post['clearType'];
             if ($clearType == OrderClass::CLEAR_DEBT) {
                 $post['debt'] = OrderClass::DEBT_YES;
                 $post['payWay'] = dict::getDict('payWay', 'debtPay');