导出可定义文件名称

This commit is contained in:
2022-10-12 16:09:07 +08:00
parent 8dae0d45d5
commit 2fc1c23934
2 changed files with 14 additions and 1 deletions

View File

@@ -122,7 +122,13 @@ trait Curd
$content = \app\common\tools\ExportTools::excel($this->model, $where, $fields, $image_fields, $select_fields, $date_fields);
return download($content, $this->model->getName() . date('YmdHis') . '.xlsx', true);
$export_file_name = $this->exportFileName;
if (empty($export_file_name)) {
$export_file_name = $this->model->getName();
}
return download($content, $export_file_name . date('YmdHis') . '.xlsx', true);
}
/**