|
|
@@ -78,18 +78,18 @@ class OrderFlash |
|
|
|
|
|
|
|
|
|
|
|
// 条件三 |
|
|
|
$delivery = (new DeliveryRuleModel())->cityInScopeOfDelivery($extra['city_id'], $extra['delivery_id']); |
|
|
|
if (!$delivery) { |
|
|
|
throw new Exception(__('Your receiving address is not within the scope of delivery')); |
|
|
|
} else { |
|
|
|
if ($delivery['min'] > array_sum($numbers)) { |
|
|
|
throw new Exception(__('You must purchase at least %s item to use this shipping method', $delivery['min'])); |
|
|
|
} |
|
|
|
} |
|
|
|
$address = (new Address)->where(['id' => $extra['address_id'], 'user_id' => $extra['userId']])->find(); |
|
|
|
if (!$address) { |
|
|
|
throw new Exception(__('Address not exist')); |
|
|
|
} |
|
|
|
// $delivery = (new DeliveryRuleModel())->cityInScopeOfDelivery($extra['city_id'], $extra['delivery_id']); |
|
|
|
// if (!$delivery) { |
|
|
|
// throw new Exception(__('Your receiving address is not within the scope of delivery')); |
|
|
|
// } else { |
|
|
|
// if ($delivery['min'] > array_sum($numbers)) { |
|
|
|
// throw new Exception(__('You must purchase at least %s item to use this shipping method', $delivery['min'])); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// $address = (new Address)->where(['id' => $extra['address_id'], 'user_id' => $extra['userId']])->find(); |
|
|
|
// if (!$address) { |
|
|
|
// throw new Exception(__('Address not exist')); |
|
|
|
// } |
|
|
|
|
|
|
|
// 条件四 |
|
|
|
$orderPrice = 0; |
|
|
@@ -108,7 +108,7 @@ class OrderFlash |
|
|
|
// 没有优惠券 |
|
|
|
$coupon = []; |
|
|
|
|
|
|
|
$params = [$products, $delivery, $coupon, $baseProductInfo, $address, $orderPrice, $specs, $numbers]; |
|
|
|
$params = [$products, [], $coupon, $baseProductInfo, [], $orderPrice, $specs, $numbers]; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|