shish 3 éve
szülő
commit
4311144b9b

+ 6 - 2
app-hd/controllers/PurchaseController.php

@@ -139,6 +139,7 @@ class PurchaseController extends BaseController
                         if (in_array(strtotime($sendTimeWant), $hasDate) == false) {
                             util::fail("【{$currentName}】在{$sendTimeWant}没有预售");
                         }
+                        $post['presell'] = 1;
                     }
                 }
                 if (count($productInfoList) != count($ids)) {
@@ -312,20 +313,23 @@ class PurchaseController extends BaseController
         $id = $get['id'] ?? 0;
         $info = PurchaseService::getInfo($id, true, true);
         if (isset($info['mainId']) == false || $info['mainId'] != $this->mainId) {
+            //不能注释,好像分享付款功能要用
             //util::fail('没有权限访问');
         }
-
         $customId = $info['customId'] ?? 0;
         $custom = CustomClass::getById($customId);
         $hasDebtPay = $custom['debt'] ?? 0;
         $book = $info['book'] ?? 0;
+        $presell = $info['presell'] ?? 0;
         //预售不能记欠款
         if ($book == 1) {
             $hasDebtPay = 0;
         }
+        if ($presell == 1) {
+            $hasDebtPay = 0;
+        }
         $info['hasDebtPay'] = $hasDebtPay;
         $info['balance'] = $this->shop->balance ?? 0;
-
         util::success($info);
     }
 

+ 2 - 0
biz-hd/purchase/services/PurchaseService.php

@@ -67,6 +67,7 @@ class PurchaseService extends BaseService
         $sendTimeWant = isset($data['sendTimeWant']) && !empty($data['sendTimeWant']) ? $data['sendTimeWant'] : date("Y-m-d");
         $orderType = 2;
         $book = $data['book'] ?? 0;
+        $presell = $data['presell'] ?? 0;
         $mainId = $custom['ownMainId'] ?? 0;
         $fromType = dict::getDict('fromType', 'mall');
         $arr = [
@@ -105,6 +106,7 @@ class PurchaseService extends BaseService
             'discount' => $discount,
             'orderType' => $orderType,
             'fromType' => $fromType,
+            'presell' => $presell,
         ];
         $result = OrderClass::addOrder($arr);
         $saleId = $result['id'] ?? 0;