|
|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
|
|
use App\Exports\BaseExport;
|
|
|
|
|
use App\Exports\CommonExport;
|
|
|
|
|
use App\Helpers\ResponseCode;
|
|
|
|
|
use App\Models\AppointmentType;
|
|
|
|
|
use App\Models\CustomForm;
|
|
|
|
|
@ -101,12 +102,8 @@ class SupplyDemandController extends BaseController
|
|
|
|
|
}
|
|
|
|
|
})->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc');
|
|
|
|
|
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 BaseExport($export_fields, $list, $tableName), $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);
|
|
|
|
|
|