超过25万条

This commit is contained in:
邓皓元 2019-04-22 09:40:28 +08:00
parent 6fe67edbec
commit 814d1ff546

View File

@ -3,6 +3,7 @@ namespace App\Domains\Virtual\Http\Controllers;
use App\Core\Controller;
use Illuminate\Http\Request;
use App\Exceptions\NotAllowedException;
use App\Domains\Virtual\Exports\CardExport;
use App\Domains\Virtual\Services\CardService;
use App\Domains\Export\Services\ExportService;
@ -57,6 +58,10 @@ class CardController extends Controller
$conditions['type'] = 0;
$total = app(OrderCardPartitionRepository::class)->withConditions($conditions)->applyConditions()->count();
if ($total > 250000) {
throw new NotAllowedException('一次性导出数据超过25万条请添加筛选条件后重试');
}
try {
$export = new CardExport($conditions);
$queue = $total > 30000;