From aa7e70de19ffdb4f41bdc2e40a9ce83464143bfa Mon Sep 17 00:00:00 2001 From: Ying Date: Wed, 26 Apr 2023 09:35:15 +0800 Subject: [PATCH] =?UTF-8?q?perf:=E4=BC=98=E5=8C=96=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA=E7=94=A8=E4=BA=8E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/BaseController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/BaseController.php b/app/BaseController.php index 5d02c9d..bfa5628 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -380,10 +380,8 @@ class BaseController $table = $this->model->getTable(); $columns = Db::query("SHOW FULL COLUMNS FROM {$table}"); $titles = array_column($columns, 'Comment', 'Field'); + // 支持导出空白数据 用于数据导入模板 $data = $this->model->limit($limit)->page($page)->select()->toArray(); - if (empty($data)) { - return $this->error('没有可导出的数据!'); - } $folder = date('Y-m-d', time()); // 使用表注释为文件名称 $tableInfo = Db::query("SHOW TABLE STATUS LIKE '{$table}'");