|
|
@@ -294,12 +294,7 @@ class NewOrderCountingRecordService
|
|
|
return $this->isNotCurrentDate($item->date_target, $unit);
|
|
|
});
|
|
|
$filter->chunk(1000)->each(function ($item) {
|
|
|
- $insert_params = [];
|
|
|
- foreach ($item as $data) {
|
|
|
- $insert_params[] =$data->toArray();
|
|
|
- }
|
|
|
- OrderCountingRecord::query()->insert($insert_params);
|
|
|
- unset($insert_params);
|
|
|
+ OrderCountingRecord::query()->insert($item->toArray());
|
|
|
});
|
|
|
|
|
|
}
|
|
|
@@ -416,8 +411,18 @@ class NewOrderCountingRecordService
|
|
|
break;
|
|
|
}
|
|
|
$item['amount'] = $amount;
|
|
|
-
|
|
|
- return $result->push($item);
|
|
|
+ return $result->push(new OrderCountingRecord( [
|
|
|
+ 'owner_id' => $item->owner_id,
|
|
|
+ 'shop_id' => $item->shop_id,
|
|
|
+ 'warehouse_id' => $item->warehouse_id,
|
|
|
+ 'logistic_id' => $item->logistic_id,
|
|
|
+ 'date_target' => $item->date_target,
|
|
|
+ 'counting_unit' => $item->counting_unit,
|
|
|
+ 'amount'=>$item->amount,
|
|
|
+ 'year'=>$item->year,
|
|
|
+ 'month'=>$item->month,
|
|
|
+ 'week'=>$item->week
|
|
|
+ ]));
|
|
|
}
|
|
|
return $result;
|
|
|
}
|