mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
调整商城案例代码;表格由reload改为reloadData
This commit is contained in:
@@ -93,4 +93,29 @@ class Goods extends AdminController
|
||||
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="导出")
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
list($page, $limit, $where) = $this->buildTableParames();
|
||||
|
||||
$this->model = $this->model
|
||||
->withJoin('cate', 'LEFT');
|
||||
|
||||
$fields = $this->request->param('fields', '{}', null);
|
||||
$image_fields = $this->request->param('image_fields', '{}', null);
|
||||
$select_fields = $this->request->param('select_fields', '{}', null);
|
||||
$date_fields = $this->request->param('date_fields', '{}', null);
|
||||
|
||||
$fields = json_decode($fields, true);
|
||||
$image_fields = json_decode($image_fields, true);
|
||||
$select_fields = json_decode($select_fields, true);
|
||||
$date_fields = json_decode($date_fields, true);
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user