diff --git a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php index 455d9a580..e8941155d 100644 --- a/app/admin/logic/beforehand_order/BeforehandOrderLogic.php +++ b/app/admin/logic/beforehand_order/BeforehandOrderLogic.php @@ -371,6 +371,7 @@ class BeforehandOrderLogic extends BaseLogic if ($count > 0) { throw new BusinessException('订单中有数量为0的商品,请先处理'); } + $user_ship=0; if($order['uid']>0){ $user_ship=User::where('id', $order['uid'])->value('user_ship')??0; } @@ -390,7 +391,11 @@ class BeforehandOrderLogic extends BaseLogic $arr['delivery_time'] = strtotime($delivery_time); $res = WarehouseOrder::create($arr); foreach ($info as $key => $arr) { - $price=StoreProductGroupPrice::where('product_id',$arr['product_id'])->where('group_id',$user_ship)->value('price')??0; + if($user_ship==0){ + $price=0; + }else{ + $price=StoreProductGroupPrice::where('product_id',$arr['product_id'])->where('group_id',$user_ship)->value('price')??0; + } $data = [ 'warehouse_id' => $warehouse_id, 'product_id' => $arr['product_id'],