mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 03:22:51 +08:00
导出可定义文件名称
This commit is contained in:
@@ -122,7 +122,13 @@ trait Curd
|
|||||||
|
|
||||||
$content = \app\common\tools\ExportTools::excel($this->model, $where, $fields, $image_fields, $select_fields, $date_fields);
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -94,6 +94,13 @@ class AdminController extends BaseController
|
|||||||
|
|
||||||
protected $batchValidate = false;
|
protected $batchValidate = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出文件的名称,支持中文,为空则获取模型名称
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $exportFileName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化方法
|
* 初始化方法
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user