|
|
@ -204,18 +204,18 @@ class OrderController extends Controller |
|
|
|
|
|
|
|
|
//存入订单产品表
|
|
|
//存入订单产品表
|
|
|
$supplier_product_info = Product::whereIn('id', $product_ids) |
|
|
$supplier_product_info = Product::whereIn('id', $product_ids) |
|
|
->orderBy('id')->get(['id AS product_id', 'supplier_id'])->toArray(); |
|
|
|
|
|
|
|
|
->orderBy('id')->get(['id AS product_id', 'supplier_id', 'price'])->toArray(); |
|
|
|
|
|
|
|
|
$order_id = $order->id; |
|
|
$order_id = $order->id; |
|
|
$agent_id = $this->agent_id; |
|
|
$agent_id = $this->agent_id; |
|
|
$agent_product_id = $ap->id; |
|
|
$agent_product_id = $ap->id; |
|
|
|
|
|
|
|
|
$supplier_product_info = array_map(function ($v) use($order_id, $agent_id, $agent_product_id) { |
|
|
|
|
|
|
|
|
foreach ($supplier_product_info as &$v) { |
|
|
$v['order_id'] = $order_id; |
|
|
$v['order_id'] = $order_id; |
|
|
$v['agent_id'] = $agent_id; |
|
|
$v['agent_id'] = $agent_id; |
|
|
$v['agent_product_id'] = $agent_product_id; |
|
|
$v['agent_product_id'] = $agent_product_id; |
|
|
return $v; |
|
|
|
|
|
}, $supplier_product_info); |
|
|
|
|
|
|
|
|
$v['num'] = $formData['num']; |
|
|
|
|
|
} |
|
|
OrderProductItem::insert($supplier_product_info); |
|
|
OrderProductItem::insert($supplier_product_info); |
|
|
|
|
|
|
|
|
DB::commit(); |
|
|
DB::commit(); |
|
|
|