Merge pull request 'main' (#392) from main into dev

Reviewed-on: #392
This commit is contained in:
mkm 2024-12-16 11:37:38 +08:00
commit 0ebe7712fd

View File

@ -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{