|
|
@@ -93,12 +93,20 @@ class PurchaseController extends BaseController
|
|
|
//判断product数据是不是同个供货商的
|
|
|
$ghsShopInfo = ShopClass::getById($ghsShopId, true);
|
|
|
$ghsMainId = $ghsShopInfo->mainId ?? 0;
|
|
|
-
|
|
|
$isOpen = ShopClass::isOpen($ghsShopInfo);
|
|
|
- if ($isOpen == 0 && $post['book'] == 0) {
|
|
|
+ if ($isOpen == 0 && $book == 0) {
|
|
|
util::fail('本店已休息,请选择其它门店');
|
|
|
}
|
|
|
|
|
|
+ $book = $post['book'] ?? 0;
|
|
|
+ $sendTimeWant = isset($post['sendTimeWant']) && !empty($post['sendTimeWant']) ? $post['sendTimeWant'] : date("Y-m-d");
|
|
|
+ $future = date("Y-m-d", strtotime('+2 day'));
|
|
|
+ if ($book == 1) {
|
|
|
+ if (strtotime($sendTimeWant) < strtotime($future)) {
|
|
|
+ util::fail('请选择未来二天或更后时间');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
ProductClass::valid($productList, $ghsMainId);
|
|
|
|
|
|
//供货商预订单最低公斤数要求和每公斤服务费
|
|
|
@@ -152,6 +160,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 +275,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;
|
|
|
|