|
|
@@ -124,22 +124,26 @@ class PurchaseController extends BaseController
|
|
|
$presell = $currentInfo['presell'] ?? 0;
|
|
|
$presellData[] = $presell;
|
|
|
if ($presell == 1) {
|
|
|
- if (isset($post['sendTimeWant']) == false || empty($post['sendTimeWant'])) {
|
|
|
- util::fail('预售花材,请选择配送日期');
|
|
|
+ if ($book == 1) {
|
|
|
+ util::fail('预订时不能选择预售花材');
|
|
|
+ } else {
|
|
|
+ if (isset($post['sendTimeWant']) == false || empty($post['sendTimeWant'])) {
|
|
|
+ util::fail('预售花材,请选择配送日期');
|
|
|
+ }
|
|
|
+ $sendTimeWant = $post['sendTimeWant'];
|
|
|
+ if (strtotime($sendTimeWant) < $nowTime) {
|
|
|
+ util::fail('不能选择过去时间');
|
|
|
+ }
|
|
|
+ $hasDateStr = $currentInfo['presellDate'] ?? [];
|
|
|
+ $hasDate = explode(',', trim($hasDateStr));
|
|
|
+ if (empty($hasDate)) {
|
|
|
+ util::fail('预售日期有问题,请提醒门店');
|
|
|
+ }
|
|
|
+ if (in_array(strtotime($sendTimeWant), $hasDate) == false) {
|
|
|
+ util::fail("{$currentName} 在{$sendTimeWant}没有预售");
|
|
|
+ }
|
|
|
+ $post['presell'] = 1;
|
|
|
}
|
|
|
- $sendTimeWant = $post['sendTimeWant'];
|
|
|
- if (strtotime($sendTimeWant) < $nowTime) {
|
|
|
- util::fail('不能选择过去时间');
|
|
|
- }
|
|
|
- $hasDateStr = $currentInfo['presellDate'] ?? [];
|
|
|
- $hasDate = explode(',', trim($hasDateStr));
|
|
|
- if (empty($hasDate)) {
|
|
|
- util::fail('预售日期有问题,请提醒门店');
|
|
|
- }
|
|
|
- if (in_array(strtotime($sendTimeWant), $hasDate) == false) {
|
|
|
- util::fail("{$currentName} 在{$sendTimeWant}没有预售");
|
|
|
- }
|
|
|
- $post['presell'] = 1;
|
|
|
}
|
|
|
}
|
|
|
if (count($productInfoList) != count($ids)) {
|