Browse Source

员工不能开已收款订单

shish 5 years ago
parent
commit
3ab29a16c2
1 changed files with 10 additions and 8 deletions
  1. 10 8
      app-ghs/controllers/OrderController.php

+ 10 - 8
app-ghs/controllers/OrderController.php

@@ -103,14 +103,6 @@ class OrderController extends BaseController
         //$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'])) {
             if ($clearType == OrderClass::CLEAR_DEBT) {
@@ -120,6 +112,16 @@ class OrderController extends BaseController
                 $post['debt'] = OrderClass::DEBT_NO;
             }
         }
+
+        //员工不能开已收款订单
+        $debt = $post['debt'] ?? OrderClass::DEBT_YES;
+        if ($debt == OrderClass::DEBT_NO) {
+            $shopAdmin = $this->shopAdmin;
+            if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+                util::fail('没有权限');
+            }
+        }
+
         //PC端开单
         if (isset($post['getType'])) {
             $getType = $post['getType'];