调整商城案例代码;表格由reload改为reloadData

This commit is contained in:
2022-08-24 15:53:57 +08:00
parent 930d0f77bf
commit 377cc49d0b
2 changed files with 39 additions and 14 deletions

View File

@@ -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);
}
}