|
@@ -48,45 +48,44 @@ class JjhcController extends WebBaseController
|
|
|
if($keyword != "j0vOW5mBREZxdo3P"){
|
|
|
throw new ResponseException("who are you?", [], 404);
|
|
|
}
|
|
|
-// for ($room = 11;$room <= 52; $room++){
|
|
|
-// $list = DB::table("recruit_ticket")->leftJoin("recruit_appoint_info","recruit_ticket.appoint_id",'=','recruit_appoint_info.id')->where("recruit_ticket.ex_start",'2022-05-17 08:00:00')->where('recruit_ticket.ex_room',$room)->orderBy('ex_seat','ASC')->get()->toArray();
|
|
|
-//
|
|
|
-// $objPHPExcel = IOFactory::load(base_path() . "/public/cunwu.xlsx");
|
|
|
-// $sheet = $objPHPExcel->getActiveSheet();
|
|
|
-// $row = 4;
|
|
|
-// $sheet->setCellValue('A1', "晋江市公开招聘第十二批村务(社区)专职工作者
|
|
|
-//笔试参考情况一览表(第".intval($room)."考场)");
|
|
|
-//
|
|
|
-// foreach ($list as $k => $v){
|
|
|
-// $sheet->setCellValueByColumnAndRow('1',$row, $v->ex_seat);
|
|
|
-// $sheet->setCellValueByColumnAndRow('2',$row, $v->realname);
|
|
|
-// $sheet->setCellValueExplicitByColumnAndRow('3',$row, $v->ex_number,DataType::TYPE_STRING);
|
|
|
-// $row++;
|
|
|
-// }
|
|
|
-//
|
|
|
-// $writer = IOFactory::createWriter($objPHPExcel, 'Xlsx');
|
|
|
-// $writer->save(base_path() . "/public/excel/cunwu{$room}.xlsx");
|
|
|
-// }
|
|
|
+ for ($room = 1;$room <= 78; $room++){
|
|
|
+ $list = DB::table("recruit_ticket")->leftJoin("recruit_appoint_info","recruit_ticket.appoint_id",'=','recruit_appoint_info.id')->where("recruit_ticket.ex_start",'2022-05-17 08:00:00')->where('recruit_ticket.ex_room',$room)->orderBy('ex_seat','ASC')->get()->toArray();
|
|
|
|
|
|
+ $objPHPExcel = IOFactory::load(base_path() . "/public/cunwu.xlsx");
|
|
|
+ $sheet = $objPHPExcel->getActiveSheet();
|
|
|
+ $row = 4;
|
|
|
+ $sheet->setCellValue('A1', "晋江市公开招聘第十三批村务(社区)专职工作者笔试参考情况一览表(第".intval($room)."考场)");
|
|
|
|
|
|
- for ($room = 1;$room <= 78; $room++){
|
|
|
- $word = new TemplateProcessor(base_path() . "/public/cunwu.docx");
|
|
|
- $word->setValue('room', $room);
|
|
|
- if($room<10){
|
|
|
- $room = sprintf('%02s', $room);
|
|
|
+ foreach ($list as $k => $v){
|
|
|
+ $sheet->setCellValueByColumnAndRow('1',$row, $v->ex_seat);
|
|
|
+ $sheet->setCellValueByColumnAndRow('2',$row, $v->realname);
|
|
|
+ $sheet->setCellValueExplicitByColumnAndRow('3',$row, $v->ex_number,DataType::TYPE_STRING);
|
|
|
+ $row++;
|
|
|
}
|
|
|
- $list = DB::table("recruit_ticket")->leftJoin("recruit_appoint_info","recruit_ticket.appoint_id",'=','recruit_appoint_info.id')->where("recruit_ticket.ex_start",'2022-08-05 08:00:00')->where('recruit_ticket.ex_room',$room)->orderBy('ex_seat','ASC')->get()->toArray();
|
|
|
- $rows = count($list);//总行数
|
|
|
- $word->cloneRow('id', $rows);//复制行
|
|
|
- for ($i = 0; $i < $rows; $i++) {
|
|
|
- $word->setValue("id#" . ($i + 1), $i + 1);//替换变量
|
|
|
- $word->setValue("realname#" . ($i + 1), $list[$i]->realname);
|
|
|
- $word->setValue("ex_number#" . ($i + 1), $list[$i]->ex_number);
|
|
|
- $word->setValue("ex_seat#" . ($i + 1), $list[$i]->ex_seat);
|
|
|
- }
|
|
|
- $word->saveAs(base_path() ."/public/excel/cunwu{$room}.docx");//另存为
|
|
|
+
|
|
|
+ $writer = IOFactory::createWriter($objPHPExcel, 'Xlsx');
|
|
|
+ $writer->save(base_path() . "/public/excel/cunwu{$room}.xlsx");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// for ($room = 1;$room <= 78; $room++){
|
|
|
+// $word = new TemplateProcessor(base_path() . "/public/cunwu.docx");
|
|
|
+// $word->setValue('room', $room);
|
|
|
+// if($room<10){
|
|
|
+// $room = sprintf('%02s', $room);
|
|
|
+// }
|
|
|
+// $list = DB::table("recruit_ticket")->leftJoin("recruit_appoint_info","recruit_ticket.appoint_id",'=','recruit_appoint_info.id')->where("recruit_ticket.ex_start",'2022-08-05 08:00:00')->where('recruit_ticket.ex_room',$room)->orderBy('ex_seat','ASC')->get()->toArray();
|
|
|
+// $rows = count($list);//总行数
|
|
|
+// $word->cloneRow('id', $rows);//复制行
|
|
|
+// for ($i = 0; $i < $rows; $i++) {
|
|
|
+// $word->setValue("id#" . ($i + 1), $i + 1);//替换变量
|
|
|
+// $word->setValue("realname#" . ($i + 1), $list[$i]->realname);
|
|
|
+// $word->setValue("ex_number#" . ($i + 1), $list[$i]->ex_number);
|
|
|
+// $word->setValue("ex_seat#" . ($i + 1), $list[$i]->ex_seat);
|
|
|
+// }
|
|
|
+// $word->saveAs(base_path() ."/public/excel/cunwu{$room}.docx");//另存为
|
|
|
+// }
|
|
|
+
|
|
|
// $spreadsheet = new Spreadsheet();
|
|
|
// $sheet = $spreadsheet->getActiveSheet();
|
|
|
// $header = ['姓名','身份证','准考证','报考岗位'];
|