diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 13fdc5bc8..418b1f089 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -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{