|
@@ -994,17 +994,17 @@ class ImportService extends Service
|
|
if(! empty($insert)){
|
|
if(! empty($insert)){
|
|
Product::insert($insert);
|
|
Product::insert($insert);
|
|
if(! empty($insert2)){
|
|
if(! empty($insert2)){
|
|
- $insert_detail = [];
|
|
|
|
|
|
+ $insert_detail_d = [];
|
|
$last_insert_id = Product::where('crt_time',$time)
|
|
$last_insert_id = Product::where('crt_time',$time)
|
|
->pluck('id','code')
|
|
->pluck('id','code')
|
|
->toArray();
|
|
->toArray();
|
|
foreach ($insert2 as $code => $val){
|
|
foreach ($insert2 as $code => $val){
|
|
foreach ($val as $v2){
|
|
foreach ($val as $v2){
|
|
$v2['product_id'] = $last_insert_id[$code] ?? 0;
|
|
$v2['product_id'] = $last_insert_id[$code] ?? 0;
|
|
- $insert_detail[] = $v2;
|
|
|
|
|
|
+ $insert_detail_d[] = $v2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ProductPriceDetail::insert($insert_detail);
|
|
|
|
|
|
+ ProductPriceDetail::insert($insert_detail_d);
|
|
}
|
|
}
|
|
if(! empty($insert_detail)) ProductItemCodeMessage::insert(array_values($insert_detail));
|
|
if(! empty($insert_detail)) ProductItemCodeMessage::insert(array_values($insert_detail));
|
|
}
|
|
}
|