新增订单为会员等级1标识

This commit is contained in:
liu 2024-06-19 14:19:44 +08:00
parent 8ac8d073f6
commit 14d0f838fd
2 changed files with 10 additions and 2 deletions

View File

@ -84,12 +84,13 @@ class OrderLogic extends BaseLogic
$cart_select[$k]['cost'] = $find['cost'];
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
$cart_select[$k]['vip'] = 0;
if ($user && $user['user_ship'] == 1) {
//更新 会员为1的时候原价减去会员价
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
$cart_select[$k]['deduction_price'] =$deduction_price_count;
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
$cart_select[$k]['vip'] =1;
}
if ($user && $user['user_ship'] == 4) {
//更新 为4商户的时候减去商户价格

View File

@ -61,12 +61,13 @@ class StoreOrderLogic extends BaseLogic
$cart_select[$k]['cost'] = $find['cost'];
$cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价
$cart_select[$k]['deduction_price'] =self::$activity_price;//抵扣金额
$cart_select[$k]['vip'] = 0;
if ($user && $user['user_ship'] == 1) {
//更新 会员为1的时候原价减去会员价
$deduction_price_count=bcmul(bcsub($find['price'], $find['vip_price'], 2),$v['cart_num'],2);
$cart_select[$k]['deduction_price'] =$deduction_price_count;
self::$activity_price = bcadd(self::$activity_price, $deduction_price_count, 2);
$cart_select[$k]['vip'] =1;
}
if ($user && $user['user_ship'] == 4) {
@ -223,6 +224,12 @@ class StoreOrderLogic extends BaseLogic
$order['refund_type_name'] = OrderEnum::refundType($order['refund_type']) ?? '';
$order['pay_type_name'] =PayEnum::getPaySceneDesc($order['pay_type']) ?? '';
$detail =StoreOrderCartInfo::where('oid',$order['id'])->find()->toArray();
$vip =0;
if(isset($detail['cart_info']['vip']) && $detail['cart_info']['vip'] == 1){
$vip = 1;
}
$order['vip'] = $vip;
return $order->toArray();
}