perf:优化空白数据导出用于数据模板
This commit is contained in:
@@ -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}'");
|
||||
|
||||
Reference in New Issue
Block a user