优化
This commit is contained in:
parent
43ce643f45
commit
bd88acc8f4
@ -26,8 +26,14 @@ class FlowPoolMonthSync extends Command
|
||||
|
||||
$array = [];
|
||||
|
||||
DB::connection('vd_old')->table('ckb_data_pool_statis_item')->select(['td_pool_sn', 'sim', 'vd_package_sn', 'flows_used'])->orderBy('dpci_id')
|
||||
->chunk(10000, function ($chunk) use (&$array, $flowPoolsKeyByName, $realFlowPools, $flowPools, $packages) {
|
||||
$query = DB::connection('vd_old')->table('ckb_data_pool_statis_item')->select(['td_pool_sn', 'sim', 'vd_package_sn', 'flows_used'])->orderBy('dpci_id');
|
||||
|
||||
$total = $query->count();
|
||||
|
||||
$this->line('查询数据,条数 #:' . $total);
|
||||
|
||||
$query->chunk(10000, function ($chunk) use (&$array, $flowPoolsKeyByName, $realFlowPools, $flowPools, $packages) {
|
||||
echo '.';
|
||||
foreach ($chunk as $value) {
|
||||
$value = (array)$value;
|
||||
$pool_id = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user