fix(admin): 修复后台预订单用户id为0时抛出异常
- 在处理预订单时,增加了对用户id的检查 - 如果用户id为0,抛出"用户id不能为0"的异常 - 修改了购买价格的计算逻辑,使用用户所属的团体id来获取价格
This commit is contained in:
parent
70bd6f9c90
commit
4661071c65
@ -849,7 +849,14 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
}
|
||||
$order['admin_name'] = Admin::where('id', $order['admin_id'])->value('name');
|
||||
$data = WarehouseProduct::where('oid', $order['outbound_id'])->where('nums', '>', 0)->select();
|
||||
|
||||
if($order['uid']>0){
|
||||
$user_ship = User::where('id', $order['uid'])->value('user_ship');
|
||||
if($user_ship==0){
|
||||
throw new BusinessException('用户id不能为0');
|
||||
}
|
||||
}else{
|
||||
throw new BusinessException('用户id不能为0');
|
||||
}
|
||||
$total_price = 0;
|
||||
$pay_price = 0;
|
||||
$total_profit = 0;
|
||||
@ -858,7 +865,7 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name');
|
||||
$v['store_name'] = $find['store_name'];
|
||||
$v['mark'] = $find['after_sales'];
|
||||
$v['purchase']=StoreProductGroupPrice::where('product_id',$v['product_id'])->where('group_id',18)->value('price');
|
||||
$v['purchase']=StoreProductGroupPrice::where('product_id',$v['product_id'])->where('group_id',$user_ship)->value('price');
|
||||
if($v['purchase']){
|
||||
$v['pay_price'] = bcmul($v['purchase'], $v['nums'], 2);
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user