diff --git a/app/Admin/CustomButton/CompletedOnLineStepButton.php b/app/Admin/CustomButton/CompletedOnLineStepButton.php index 748642a..963437c 100644 --- a/app/Admin/CustomButton/CompletedOnLineStepButton.php +++ b/app/Admin/CustomButton/CompletedOnLineStepButton.php @@ -18,7 +18,7 @@ class CompletedOnLineStepButton extends AbstractTool // 返回自定义按钮的HTML代码 return << - + HTML; } diff --git a/app/Admin/Extensions/Exporter/ImportCompletedOnLineAllStepView.php b/app/Admin/Extensions/Exporter/ImportCompletedOnLineAllStepView.php new file mode 100644 index 0000000..4801860 --- /dev/null +++ b/app/Admin/Extensions/Exporter/ImportCompletedOnLineAllStepView.php @@ -0,0 +1,94 @@ +fileName = $this->fileName.'_'.time().'.xlsx';//拼接下载文件名称 + $this->titles = [ + 'name'=> '姓名', + 'mobile'=> '手机', + 'idcard'=> '身份证', + 'sex'=> '性别', + 'speciality_name'=> '专业', + 'conllege_name'=> '二级学院', + 'one'=> '入学指南', + 'two'=> '招生信息核对', + 'three'=> '学生信息采集', + 'four'=> '在线缴费', + 'five'=> '预选宿舍', + 'six'=> '生成报到单', + 'annual_session'=> '年份', + 'is_test'=> '是否为测试账号', + ]; + parent::__construct(); + } + + public function export() + { + // TODO: Implement export() method. + $this->download($this->fileName)->prepare(request())->send(); + exit; + } + + public function collection() + { + // TODO: Implement collection() method. +// return collect($this->buildData()); + + //取出当前年份 + $config = Config::query()->where([ + "unique_identification" => "annual_session" + ])->first(); + + $list = CompletedOnLineAllStepView::query()->where([ + "annual_session" => $config->data, + ])->get()->toArray(); + + return collect($list); + } + + public function headings(): array + { + // TODO: Implement headings() method. + return $this->titles(); + } + + public function map($row): array + { + // TODO: Implement map() method. + return [ + $row["name"], + $row["mobile"], + "'".$row['idcard'].'', + $row["sex"], + $row["speciality_name"], + $row["college_name"], + $row["one"], + $row["two"], + $row["three"], + $row["four"], + $row["five"], + $row["six"], + $row["annual_session"], + $row["is_test"], + ]; + } +} diff --git a/app/Models/CompletedOnLineAllStepView.php b/app/Models/CompletedOnLineAllStepView.php new file mode 100644 index 0000000..b256492 --- /dev/null +++ b/app/Models/CompletedOnLineAllStepView.php @@ -0,0 +1,15 @@ +group(function(){ Route::any("completedOnLineStep", [ImportCompletedOnLineStepView::class, "export"]); Route::any("completedOffLineStep", [ImportCompletedOfflineStep::class, "export"]); + Route::any("completedOffLineAllStep", [ImportCompletedOnLineAllStepView::class, "export"]); Route::any("userBaseInfoExcel", [ImportUserBaseInfo::class, "export"]); });