|
@@ -19,12 +19,17 @@ class LabelDealService extends Service
|
|
|
if( empty($data['lead_out']) || empty($data['lead_out']['brand_out_stock_list'])) return;
|
|
|
|
|
|
foreach ($data['lead_out']['brand_out_stock_list'] as $value){
|
|
|
- $tmp = $value['brand_out_stock_dtl'][0] ?? [];
|
|
|
- $return[$value['send_box_code']] = [
|
|
|
- 'fake_qty' => $tmp['fake_qty'],
|
|
|
- 'detail' => explode(',',$tmp['brand_qr_code_list'])
|
|
|
- ];
|
|
|
$box_list[] = $value['send_box_code'];
|
|
|
+ foreach ($value['brand_out_stock_dtl'] as $tmp){
|
|
|
+ if(! isset($return[$value['send_box_code']])){
|
|
|
+ $return[$value['send_box_code']] = [
|
|
|
+ 'fake_qty' => 0,
|
|
|
+ 'detail' => [],
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $return[$value['send_box_code']]['fake_qty'] += $tmp['fake_qty'];
|
|
|
+ $return[$value['send_box_code']]['detail'] = array_merge($return[$value['send_box_code']]['detail'], explode(',',$tmp['brand_qr_code_list']));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|