Bläddra i källkod

预售不能记欠款

shish 3 år sedan
förälder
incheckning
df5b801d5c
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      app-hd/controllers/PurchaseController.php

+ 8 - 0
app-hd/controllers/PurchaseController.php

@@ -152,6 +152,9 @@ class PurchaseController extends BaseController
         if ($info->status != 1) {
             util::fail('订单不是待付款状态');
         }
+        if ($info->book == 1) {
+            util::fail('预售不能记欠款');
+        }
 
         $ghsId = $info->ghsId;
         $ghs = GhsClass::getGhsInfo($ghsId);
@@ -264,6 +267,11 @@ class PurchaseController extends BaseController
         $customId = $info['customId'] ?? 0;
         $custom = CustomClass::getById($customId);
         $hasDebtPay = $custom['debt'] ?? 0;
+        $book = $info['book'] ?? 0;
+        //预售不能记欠款
+        if ($book == 1) {
+            $hasDebtPay = 0;
+        }
         $info['hasDebtPay'] = $hasDebtPay;
         $info['balance'] = $this->shop->balance ?? 0;