Ver Fonte

充值销账

shish há 1 ano atrás
pai
commit
0746e0596d
1 ficheiros alterados com 9 adições e 6 exclusões
  1. 9 6
      app-ghs/controllers/OrderClearController.php

+ 9 - 6
app-ghs/controllers/OrderClearController.php

@@ -115,7 +115,7 @@ class OrderClearController extends BaseController
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
         $payWay = $get['payWay'] ?? dict::getDict('payWay', 'wxPay');
-        $payRemark = $get['payRemark']??'';
+        $payRemark = $get['payRemark'] ?? '';
         $clear = OrderClearClass::getById($id, true);
         if (empty($clear)) {
             util::fail('没有找到结账单');
@@ -126,10 +126,13 @@ class OrderClearController extends BaseController
         if ($ghs->shopId != $this->shopId) {
             util::fail('没有获得授权');
         }
+        if($ghs->balance > 0){
+            util::fail('客户有余额,不能拿订单销账,请走充值。有疑问请联系技术员');
+        }
 
         $staff = $this->shopAdmin;
-        if (isset($staff->finance) == false || $staff->finance == 0) {
-            util::fail('不能销单...');
+        if (!isset($staff->finance) || $staff->finance == 0) {
+            util::fail('没有财务权限,不能销单哦');
         }
 
         //避免网络延迟,造成重复操作
@@ -173,7 +176,7 @@ class OrderClearController extends BaseController
                 }
             }
             //恋善好多花控制销账权限
-            if (in_array($this->shopId, [55238,56609,56611])) {
+            if (in_array($this->shopId, [55238, 56609, 56611])) {
                 if (!in_array($this->adminId, [43856, 54620])) {
                     util::fail('暂无权限,请联系老板或财务');
                 }
@@ -198,13 +201,13 @@ class OrderClearController extends BaseController
             }
             //源花汇
             if (in_array($this->shopId, [10649])) {
-                if (!in_array($this->adminId, [11641, 11648,4])) {
+                if (!in_array($this->adminId, [11641, 11648, 4])) {
                     util::fail('请闵总或小周操作');
                 }
             }
             //昱成
             if (in_array($this->shopId, [8596])) {
-                if (!in_array($this->adminId, [9303,9601])) {
+                if (!in_array($this->adminId, [9303, 9601])) {
                     util::fail('只能叶荷和财务操作');
                 }
             }