feat: 修改订单逻辑,增加生鲜产品订单金额大于200元的校验
This commit is contained in:
parent
42a9130a7a
commit
f3e83cda79
@ -130,7 +130,7 @@ class OrderLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
//计算生鲜
|
//计算生鲜
|
||||||
if ($createOrder == 1 && $find['top_cate_id'] == 15201) {
|
if ($createOrder == 1 && $find['top_cate_id'] == 15201) {
|
||||||
$fresh_price=bcadd($fresh_price,$cart_select[$k]['pay_price']);
|
$fresh_price = bcadd($fresh_price, $cart_select[$k]['pay_price']);
|
||||||
}
|
}
|
||||||
$cart_select[$k]['product_id'] = $find['product_id'];
|
$cart_select[$k]['product_id'] = $find['product_id'];
|
||||||
$cart_select[$k]['old_cart_id'] = $v['id'];
|
$cart_select[$k]['old_cart_id'] = $v['id'];
|
||||||
@ -172,14 +172,15 @@ class OrderLogic extends BaseLogic
|
|||||||
// $pay_price = self::$pay_price;
|
// $pay_price = self::$pay_price;
|
||||||
// } else {
|
// } else {
|
||||||
|
|
||||||
|
|
||||||
|
$pay_price = bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额
|
||||||
//判断生鲜是否大于200
|
//判断生鲜是否大于200
|
||||||
if($createOrder==1 && $fresh_price>0){
|
if ($createOrder == 1 && $fresh_price > 0) {
|
||||||
if($fresh_price<200){
|
if ($pay_price < 200) {
|
||||||
self::setError('订单里的生鲜必须大于金额200元');
|
self::setError('订单包含生鲜产品,订单金额必须大于200元,才能下单');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pay_price = bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额
|
|
||||||
// }
|
// }
|
||||||
//成本价 收益
|
//成本价 收益
|
||||||
$order = [
|
$order = [
|
||||||
@ -263,7 +264,7 @@ class OrderLogic extends BaseLogic
|
|||||||
$params['order_id'] = $order_id;
|
$params['order_id'] = $order_id;
|
||||||
$params['verify_code'] = $verify_code;
|
$params['verify_code'] = $verify_code;
|
||||||
$orderInfo = self::cartIdByOrderInfo($cartId, $addressId, $user, $params, 1);
|
$orderInfo = self::cartIdByOrderInfo($cartId, $addressId, $user, $params, 1);
|
||||||
if($orderInfo==false){
|
if ($orderInfo == false) {
|
||||||
self::setError(self::getError());
|
self::setError(self::getError());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user