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}'");