|
|
|
|
@ -141,12 +141,8 @@ class CourseController extends BaseController
|
|
|
|
|
});
|
|
|
|
|
$list = $list->orderBy($all['sort_name'] ?? 'sign_status', $all['sort_type'] ?? 'asc');
|
|
|
|
|
if (isset($all['is_export']) && !empty($all['is_export'])) {
|
|
|
|
|
$list = $list->get()->toArray();
|
|
|
|
|
$export_fields = $all['export_fields'] ?? [];
|
|
|
|
|
// 导出文件名字
|
|
|
|
|
$tableName = $this->model->getTable();
|
|
|
|
|
$filename = (new CustomForm())->getTableComment($tableName);
|
|
|
|
|
return Excel::download(new CommonExport($export_fields, $list), $filename . date('YmdHis') . '.xlsx');
|
|
|
|
|
$list = $list->limit(5000)->get()->toArray();
|
|
|
|
|
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), $all['file_name'] ?? '' . date('YmdHis') . '.xlsx');
|
|
|
|
|
} else {
|
|
|
|
|
// 输出
|
|
|
|
|
$list = $list->paginate($all['page_size'] ?? 20);
|
|
|
|
|
|