created_at
This commit is contained in:
parent
9a767f2cff
commit
354a84e6bb
@ -87,8 +87,8 @@ class AddedOrderSync extends Command
|
|||||||
$endtime = $this->datetime->copy()->endOfMonth()->endOfDay();
|
$endtime = $this->datetime->copy()->endOfMonth()->endOfDay();
|
||||||
|
|
||||||
$orders = DB::table($virtualTable)->selectRaw('sim,MAX(order_id)')
|
$orders = DB::table($virtualTable)->selectRaw('sim,MAX(order_id)')
|
||||||
->where('create_time', '>=', $starttime->timestamp)
|
->where('created_at', '>=', $starttime)
|
||||||
->where('create_time', '<=', $endtime->timestamp)
|
->where('created_at', '<=', $endtime)
|
||||||
->whereIn('sim', array_pluck($data, 'sim'))
|
->whereIn('sim', array_pluck($data, 'sim'))
|
||||||
->groupBy('sim')->get()->pluck('order_id', 'sim');
|
->groupBy('sim')->get()->pluck('order_id', 'sim');
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ class OrderBaseSync extends Command
|
|||||||
$this->line('插入订单关联数据,条数:'.count($cards));
|
$this->line('插入订单关联数据,条数:'.count($cards));
|
||||||
foreach (array_chunk($cards, $this->chunks) as $data) {
|
foreach (array_chunk($cards, $this->chunks) as $data) {
|
||||||
$this->getOutput()->write('.');
|
$this->getOutput()->write('.');
|
||||||
$orders = DB::table('virtual_order_cards')->select(['sim', 'order_id'])->whereIn('sim', array_pluck($data, 'sim'))->get()->pluck('order_id', 'sim');
|
$orders = DB::table('virtual_order_cards')->select(['sim', 'order_id'])
|
||||||
|
->whereIn('sim', array_pluck($data, 'sim'))->get()->pluck('order_id', 'sim');
|
||||||
|
|
||||||
foreach ($data as &$value) {
|
foreach ($data as &$value) {
|
||||||
$value['virtual_order_id'] = $orders[$value['sim']] ?? 0;
|
$value['virtual_order_id'] = $orders[$value['sim']] ?? 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user