This commit is contained in:
邓皓元 2019-02-26 16:54:19 +08:00
parent ae8d77edea
commit 96efb5d62e

View File

@ -133,8 +133,12 @@ class FlowPoolService extends Service
'cards.virtual_activated_at'
];
$flows = app(FlowPoolMonth::class)->setTable($table)->leftJoin('cards', 'cards.sim', '=', "{$table}.sim")->select($select)
if (Schema::hasTable($table)) {
$flows = app(FlowPoolMonth::class)->setTable($table)->leftJoin('cards', 'cards.sim', '=', "{$table}.sim")->select($select)
->whereIn('pool_id', $flowPools->pluck('id')->toArray())->get()->groupBy('pool_id');
} else {
$flows = [];
}
// 流量统计
$flowPools->map(function ($flowPool) use ($month, $flows) {