IndexController.php 125 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879
  1. <?php
  2. namespace App\Http\Controllers\Web\Recruit;
  3. use App\Http\Controllers\Web\WebBaseController;
  4. use App\Models\RecruitAppointLog;
  5. use App\Models\RecruitTicket;
  6. use App\Validators\RecruitValidatorRequest;
  7. use Illuminate\Http\Request;
  8. use App\Models\Recruit;
  9. use App\Services\Recruit\RecruitService;
  10. use App\Models\RecruitAppointBasic;
  11. use App\Models\RecruitSupplement;
  12. use App\Models\RecruitPost;
  13. use App\Models\RecruitAppointInfo;
  14. use think\Route;
  15. use Illuminate\Support\Facades\Validator;
  16. use Illuminate\Support\Facades\DB;
  17. use App\Models\RecruitAppointExpandSpecial;
  18. use App\Models\RecruitAppointDetail;
  19. use App\Models\RecruitArticle;
  20. use Illuminate\Support\Facades\Cache;
  21. use App\Services\Common\BaiduService;
  22. use App\Models\RecruitAppointSelect;
  23. class IndexController extends WebBaseController
  24. {
  25. protected $recruitService,$baiduService;
  26. public function __construct(RecruitService $recruitService,BaiduService $baiduService)
  27. {
  28. $this->recruitService = $recruitService;
  29. $this->baiduService = $baiduService;
  30. }
  31. /**
  32. * 招考列表页
  33. * @param Request $request
  34. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed|\think\response\View
  35. */
  36. public function index(Request $request)
  37. {
  38. $key = $request->input('key');
  39. $list = $this->recruitService->getRecruit($key, 10);
  40. $return_data = [
  41. 'list' => $list,
  42. 'key' => $key,
  43. ];
  44. return view('app.recruit.index', $return_data);
  45. }
  46. /**
  47. * 招考详情页
  48. * @param Request $request
  49. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View|mixed|\think\response\Redirect|\think\response\View|void
  50. */
  51. public function show(Request $request)
  52. {
  53. $user = $this->getUser();
  54. if($user){
  55. $uid = $user->id;
  56. $utype = $user->utype;
  57. }else{
  58. $uid = 0;
  59. $utype = 0;
  60. }
  61. $id = $request->input('id', 0);
  62. if (empty($id)) {
  63. return $this->showMessage('抱歉,请输入指定的招考场次!', route('recruit.index.list'), true, '上一页', '2');
  64. }
  65. $recruit = Recruit::find($id);
  66. if (empty($recruit)) {
  67. return redirect(route('/recruit/list'));
  68. }
  69. $info = Recruit::parse_info($recruit);
  70. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  71. if($info->isApply && $appoint_info){
  72. $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->orderBy('created_at','asc')->first();
  73. if($first_post){
  74. $info->isApply = 1;
  75. }
  76. }
  77. if($appoint_info){
  78. //20221115增加确认笔试功能
  79. if($recruit->pen_comfirm){
  80. if($appoint_info->audit != 3){//审核未通过,无需确认
  81. $appoint_info->pen_comfirm = 0;
  82. }else{
  83. $time = time();
  84. if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
  85. $appoint_info->pen_comfirm = -1; //确认未开始
  86. }else{
  87. if($appoint_info->pen_audit != -2){
  88. $appoint_info->pen_comfirm = -2;//已确认无需再次确认
  89. }else{
  90. $appoint_info->pen_comfirm = 1;
  91. }
  92. }
  93. }
  94. }else{
  95. $appoint_info->pen_comfirm = 0;//无需确认
  96. }
  97. //笔试
  98. $pen_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',1)->first();
  99. if($pen_ticket){
  100. $pen_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","pen")->where('h_status',1)->first();
  101. if(!$pen_health && $recruit->pen_epidemic){
  102. $appoint_info->pen_ticket = -2;
  103. }else{
  104. $time = time();
  105. if(strtotime($pen_ticket->ex_start) < $time && strtotime($pen_ticket->ex_end) > $time){
  106. $appoint_info->pen_ticket = 1;
  107. }else{
  108. $appoint_info->pen_ticket = -1;
  109. }
  110. }
  111. }else{
  112. $appoint_info->pen_ticket = 0;
  113. }
  114. //考核测试
  115. $check_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',2)->first();
  116. if($check_ticket){
  117. $time = time();
  118. if(strtotime($check_ticket->ex_start) < $time && strtotime($check_ticket->ex_end) > $time){
  119. $appoint_info->check_ticket = 1;
  120. }else{
  121. $appoint_info->check_ticket = -1;
  122. }
  123. }else{
  124. $appoint_info->check_ticket = 0;
  125. }
  126. //面试
  127. $face_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',3)->first();
  128. if($face_ticket && $appoint_info->face_audit == -1){
  129. $face_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","face")->where('h_status',1)->first();
  130. if(!$face_health && $recruit->face_epidemic){
  131. $appoint_info->face_ticket = -2;
  132. $time = time();
  133. if(strtotime($recruit->face_health_start) < $time && strtotime($recruit->face_health_end) > $time){
  134. $appoint_info->face_ticket = -2;
  135. }else{
  136. $appoint_info->face_ticket = -3;
  137. }
  138. }else{
  139. $time = time();
  140. if(strtotime($recruit->face_health_start) < $time && strtotime($recruit->face_health_end) > $time){
  141. $appoint_info->face_ticket = 1;
  142. }else{
  143. $appoint_info->face_ticket = -1;
  144. }
  145. }
  146. }else{
  147. $appoint_info->face_ticket = 0;
  148. }
  149. //复试
  150. $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
  151. if($reexamine_ticket && $appoint_info->reexamine_audit == -1){
  152. $reexamine_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","reexamine")->where('h_status',1)->first();
  153. if(!$reexamine_health && $recruit->reexamine_epidemic){
  154. $appoint_info->face_ticket = -2;
  155. $time = time();
  156. if(strtotime($recruit->reexamine_health_start) < $time && strtotime($recruit->reexamine_health_end) > $time){
  157. $appoint_info->reexamine_ticket = -2;
  158. }else{
  159. $appoint_info->reexamine_ticket = -3;
  160. }
  161. }else{
  162. $time = time();
  163. if(strtotime($recruit->reexamine_health_start) < $time && strtotime($recruit->reexamine_health_end) > $time){
  164. $appoint_info->reexamine_ticket = 1;
  165. }else{
  166. $appoint_info->reexamine_ticket = -1;
  167. }
  168. }
  169. }else{
  170. $appoint_info->reexamine_ticket = 0;
  171. }
  172. }else{
  173. $appoint_info = new \stdClass();
  174. $appoint_info->pen_comfirm = 0;
  175. $appoint_info->pen_audit = 0;
  176. $appoint_info->post_id = 0;
  177. $appoint_info->pen_ticket = 0;
  178. $appoint_info->computer_ticket = 0;
  179. $appoint_info->face_ticket = 0;
  180. $appoint_info->check_ticket = 0;
  181. $appoint_info->reexamine_ticket = 0;
  182. $appoint_info->realname = '';
  183. $appoint_info->card = '';
  184. $appoint_info->mobile = '';
  185. $appoint_info->sex = 0;
  186. $appoint_info->adjust = 0;
  187. $appoint_info->adjust_limit = 0;
  188. }
  189. $notice = $request->input('notice',0);
  190. if($notice){
  191. $public_notice_switch = 0;
  192. $public_notice = RecruitArticle::where('id',$notice)->where('released_at','<',time())->first();
  193. if (!empty($info)) {
  194. $view_data = [
  195. 'recruit' => $recruit,
  196. 'info' => $info,
  197. 'uid' => $uid,
  198. 'utype' => $utype,
  199. 'public_notice' => $public_notice,
  200. 'public_notice_switch' => $public_notice_switch,
  201. 'appoint_info' => $appoint_info
  202. ];
  203. return view('app.recruit.show')->with($view_data);
  204. } else {
  205. return back();
  206. }
  207. }else{
  208. $list = RecruitArticle::where('recruit_id',$id)->where('is_display',1)->orderBy('created_at','desc')->where('released_at','<',time())->get();
  209. $public_notice_switch = 1;//有补充公告的模式
  210. if (!empty($info)) {
  211. $view_data = [
  212. 'recruit' => $recruit,
  213. 'info' => $info,
  214. 'uid' => $uid,
  215. 'utype' => $utype,
  216. 'list' => $list,
  217. 'public_notice_switch' => $public_notice_switch,
  218. 'appoint_info' => $appoint_info
  219. ];
  220. return view('app.recruit.show')->with($view_data);
  221. } else {
  222. return back();
  223. }
  224. }
  225. }
  226. /**
  227. * 上传文件的方法
  228. * @param Request $request
  229. * @return \Illuminate\Http\JsonResponse
  230. */
  231. public function upload(Request $request)
  232. {
  233. $user = $this->getUser();
  234. if($user){
  235. $uid = $user->id;
  236. $utype = $user->utype;
  237. }else{
  238. $uid = 0;
  239. $utype = 0;
  240. }
  241. $file = $request->file('file');
  242. if ($file->isValid()) { //判断文件是否存在
  243. //获取文件的扩展名
  244. $ext = $file->getClientOriginalExtension();
  245. if (!in_array(strtolower($ext), ['jpg', 'jpeg', 'png', 'doc', 'docx', 'pdf'])) {
  246. $res['status'] = 0;
  247. $res['msg'] = '文件格式不正确';
  248. } else {
  249. //获取文件的绝对路径
  250. $path = $file->getRealPath();
  251. $oldname = $file->getClientOriginalName();
  252. //定义文件名
  253. $filename = 'storage/recruit/' . uniqid() . mt_rand(10000, 99999) . '.' . $ext;
  254. //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置
  255. Storage::disk('public')->put($filename, file_get_contents($path));
  256. $res['status'] = 1;
  257. $res['filename'] = $oldname;
  258. $res['path'] = "/storage/" . $filename;
  259. $res['msg'] = '上传成功';
  260. }
  261. } else {
  262. $res['status'] = 0;
  263. $res['msg'] = '上传失败';
  264. }
  265. return response()->json($res);
  266. }
  267. /**
  268. * 查看报名人数统计
  269. * @param Request $request
  270. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View|mixed|\think\response\Redirect|\think\response\View|void
  271. */
  272. public function sign_up_count(Request $request)
  273. {
  274. $user = $this->getUser();
  275. if($user){
  276. $uid = $user->id;
  277. $utype = $user->utype;
  278. }else{
  279. $uid = 0;
  280. $utype = 0;
  281. }
  282. $id = $request->input('id', 0);
  283. $refresh = $request->input('refresh', '');
  284. if (empty($id)) {
  285. return $this->showMessage('抱歉,请输入指定的招考场次!', route('recruit.index.list'), true, '上一页', '2');
  286. }
  287. $recruit = Recruit::find($id);
  288. if (empty($recruit)) {
  289. return redirect(route('/recruit/list'));
  290. }
  291. if(!$recruit->show_report){
  292. return $this->showMessage('抱歉,该场次不允许查看报名人数统计结果!', route('recruit.index.list'), true, '上一页', '2');
  293. }
  294. if(Cache::has("sign_up_count_{$recruit->id}") && $refresh != 'jjhc2019') {
  295. $cache_data = Cache::get("sign_up_count_{$recruit->id}");
  296. $list = $cache_data['list'];
  297. $time = $cache_data['time'];
  298. }else{
  299. $list = RecruitPost::where('recruit_id',$recruit->id)->where('status',1)->get();
  300. if(!$list){
  301. return $this->showMessage('抱歉,数据暂时未更新或更新出错!', route('recruit.index.list'), true, '上一页', '2');
  302. }
  303. foreach ($list as $k => $v){
  304. $res = RecruitAppointInfo::select(DB::raw("count(case audit when 1 then 1 end) as 'checking', count(case audit when 2 then 2 end) as 'fail',count(case audit when 3 then 3 end) as 'success'"))->where('recruit_id',$recruit->id)->where('post_id',$v->id)->first();
  305. $list[$k]['checking'] = $res->checking;
  306. $list[$k]['fail'] = $res->fail;
  307. $list[$k]['success'] = $res->success;
  308. }
  309. $time = date('Y-m-d H:i',time());
  310. $cache_data = [
  311. 'list' => $list,
  312. 'time' => $time
  313. ];
  314. Cache::put("sign_up_count_{$recruit->id}",$cache_data,60);
  315. }
  316. $view_data = [
  317. 'list' => $list,
  318. 'time' => $time,
  319. 'title' => $recruit->company
  320. ];
  321. return view('app.recruit.sign_up_count')->with($view_data);
  322. }
  323. /**
  324. * 报名功能页
  325. * @param Request $request
  326. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View|mixed|\think\response\Redirect|\think\response\View|void
  327. */
  328. public function sign_up(Request $request)
  329. {
  330. $user = $this->getUser();
  331. if (!empty($user)) {
  332. $uid = $user->id;
  333. } else {
  334. return redirect(route('login'));
  335. }
  336. //招考id
  337. $id = $request->input('id', 0);
  338. if (!$id) {
  339. return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
  340. }
  341. //招考信息
  342. $recruit = Recruit::find($id);
  343. if(!$recruit['status'] && !$user->recruit_test){
  344. return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  345. }
  346. if($recruit['current'] != 1 && $recruit['current'] != 2){
  347. return $this->showMessage('抱歉,该项目报名通道已关闭,如有疑问,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  348. }
  349. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  350. $time = time();
  351. $formDisabled = 0;
  352. if(($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)){//过了招考时间
  353. if(!in_array($uid,[161027,59041])){
  354. if(!$appoint_info){
  355. return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  356. }
  357. if($appoint_info){
  358. //如果有报名记录,先查询首次报名是什么时候
  359. $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->where('appoint_id',$appoint_info->id)->orderBy('created_at','asc')->first();
  360. if(!$first_post){//没有记录代表只是暂存
  361. return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  362. }
  363. // $has_late_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->where('created_at','>',$recruit['apply_end'])->first();//查找在过了报名时间后,有报名记录,且仍是审核失败的报名记录,看其是否在报名时间后是否有再次提交的记录
  364. // if($has_late_post){
  365. // $formDisabled = 1;
  366. // }else{
  367. // $formDisabled = 0;
  368. // }
  369. }
  370. }
  371. }
  372. $view_data['module'] = $forms = explode(',', $recruit['forms']);
  373. //查询报名表是否已有记录
  374. if($appoint_info){
  375. if(in_array('internship',$forms)) {
  376. //如果已有该场次的报名记录,读取录入的数据集合
  377. $user_info = $appoint_info;
  378. $user_info['sex'] = (string)$user_info['sex'];
  379. $user_info['adjust'] = (string)$user_info['adjust'];
  380. $user_info['edu_type'] = (string)$user_info['edu_type'];
  381. $user_info['family'] = json_decode($user_info['family']);
  382. $detail = RecruitAppointDetail::where('recruit_appoint_id',$user_info['id'])->first();
  383. if($detail){
  384. $user_info['detail'] = $detail->toArray();
  385. }else{
  386. $user_info['detail'] = [
  387. 'rewards_and_punishments' => '',
  388. 'introduce' => ''
  389. ];
  390. }
  391. if(json_decode($user_info['identification'])){
  392. $identification = json_decode($user_info['identification'],true);
  393. foreach ($identification as $k => $v){
  394. if(array_key_exists('response',$v)){
  395. $identification[$k]['url'] = $v['response']['path'];
  396. }
  397. }
  398. }else{
  399. $identification = [];
  400. }
  401. $user_info['identification'] = $identification;
  402. if(json_decode($user_info['education_certification'])){
  403. $education_certification = json_decode($user_info['education_certification'],true);
  404. foreach ($education_certification as $k => $v){
  405. if(array_key_exists('response',$v)){
  406. $education_certification[$k]['url'] = $v['response']['path'];
  407. }
  408. }
  409. }else{
  410. $education_certification = [];
  411. }
  412. $user_info['education_certification'] = $education_certification;
  413. if(json_decode($user_info['other_certification'])){
  414. $other_certification = json_decode($user_info['other_certification'],true);
  415. foreach ($other_certification as $k => $v){
  416. if(array_key_exists('response',$v)){
  417. $other_certification[$k]['url'] = $v['response']['path'];
  418. }
  419. }
  420. }else{
  421. $other_certification = [];
  422. }
  423. $user_info['other_certification'] = $other_certification;
  424. if(json_decode($user_info['chengnuoshu'])){
  425. $chengnuoshu = json_decode($user_info['chengnuoshu'],true);
  426. foreach ($chengnuoshu as $k => $v){
  427. if(array_key_exists('response',$v)){
  428. $chengnuoshu[$k]['url'] = $v['response']['path'];
  429. }
  430. }
  431. }else{
  432. $chengnuoshu = [];
  433. }
  434. $user_info['chengnuoshu'] = $chengnuoshu;
  435. if(json_decode($user_info['shixin'])){
  436. $shixin = json_decode($user_info['shixin'],true);
  437. foreach ($shixin as $k => $v){
  438. if(array_key_exists('response',$v)){
  439. $shixin[$k]['url'] = $v['response']['path'];
  440. }
  441. }
  442. }else{
  443. $shixin = [];
  444. }
  445. $user_info['shixin'] = $shixin;
  446. if(json_decode($user_info['baokaoshengming'])){
  447. $baokaoshengming = json_decode($user_info['baokaoshengming'],true);
  448. foreach ($baokaoshengming as $k => $v){
  449. if(array_key_exists('response',$v)){
  450. $baokaoshengming[$k]['url'] = $v['response']['path'];
  451. }
  452. }
  453. }else{
  454. $baokaoshengming = [];
  455. }
  456. $user_info['baokaoshengming'] = $baokaoshengming;
  457. //获取最新的报名审核信息
  458. $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
  459. if($logs){
  460. $user_info['audit_log'] = $logs->log;
  461. }else{
  462. $user_info['audit_log'] = '';
  463. }
  464. }else{
  465. //如果已有该场次的报名记录,读取录入的数据集合
  466. $user_info = $appoint_info;
  467. $user_info['sex'] = (string)$user_info['sex'];
  468. $user_info['edu_type'] = (string)$user_info['edu_type'];
  469. $user_info['family'] = json_decode($user_info['family']);
  470. if(in_array('expand_special',$forms)){
  471. $special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$user_info['id'])->first();
  472. if($special){
  473. $material = json_decode($special['material'],true);
  474. if(is_array($material)){
  475. foreach ($material as $k => $v){
  476. if(array_key_exists('response',$v)){
  477. if(array_key_exists('path',$v['response'])){
  478. $material[$k]['url'] = $v['response']['path'];
  479. }
  480. }
  481. }
  482. }
  483. }else{
  484. $material = [];
  485. $special = [
  486. 'point_apply' => '0',
  487. 'condition' => ''
  488. ];
  489. }
  490. $user_info['special'] = [
  491. 'point_apply' => (string)$special['point_apply'],
  492. 'condition' => $special['condition'],
  493. 'material' => $material
  494. ];
  495. }
  496. if(in_array('detail',$forms)){
  497. $detail = RecruitAppointDetail::where('recruit_appoint_id',$user_info['id'])->first();
  498. if($detail){
  499. $user_info['detail'] = $detail->toArray();
  500. }else{
  501. $user_info['detail'] = [
  502. 'train' => '',
  503. 'rewards_and_punishments' => '',
  504. 'introduce' => ''
  505. ];
  506. }
  507. }
  508. //如果有身份证明模块
  509. if(in_array('identification',$forms)){
  510. if(json_decode($user_info['identification'])){
  511. $identification = json_decode($user_info['identification'],true);
  512. foreach ($identification as $k => $v){
  513. if(array_key_exists('response',$v)){
  514. if(array_key_exists('path',$v['response'])){
  515. $identification[$k]['url'] = $v['response']['path'];
  516. }
  517. }
  518. }
  519. }else{
  520. $identification = [];
  521. }
  522. $user_info['identification'] = $identification;
  523. }
  524. //如果有教育证明模块
  525. if(in_array('education_certification',$forms)){
  526. if(json_decode($user_info['education_certification'])){
  527. $education_certification = json_decode($user_info['education_certification'],true);
  528. foreach ($education_certification as $k => $v){
  529. if(array_key_exists('response',$v)){
  530. if(array_key_exists('path',$v['response'])){
  531. $education_certification[$k]['url'] = $v['response']['path'];
  532. }
  533. }
  534. }
  535. }else{
  536. $education_certification = [];
  537. }
  538. $user_info['education_certification'] = $education_certification;
  539. }
  540. //如果有其他证明模块
  541. if(in_array('other_certification',$forms)){
  542. if(json_decode($user_info['other_certification'])){
  543. $other_certification = json_decode($user_info['other_certification'],true);
  544. foreach ($other_certification as $k => $v){
  545. if(array_key_exists('response',$v)){
  546. if(array_key_exists('path',$v['response'])){
  547. $other_certification[$k]['url'] = $v['response']['path'];
  548. }
  549. }
  550. }
  551. }else{
  552. $other_certification = [];
  553. }
  554. $user_info['other_certification'] = $other_certification;
  555. }
  556. //如果有承诺书模块
  557. if(in_array('chengnuoshu',$forms)){
  558. if(json_decode($user_info['chengnuoshu'])){
  559. $chengnuoshu = json_decode($user_info['chengnuoshu'],true);
  560. foreach ($chengnuoshu as $k => $v){
  561. if(array_key_exists('response',$v)){
  562. if(array_key_exists('path',$v['response'])){
  563. $chengnuoshu[$k]['url'] = $v['response']['path'];
  564. }
  565. }
  566. }
  567. }else{
  568. $chengnuoshu = [];
  569. }
  570. $user_info['chengnuoshu'] = $chengnuoshu;
  571. }
  572. //如果有失信被执行人模块
  573. if(in_array('shixin',$forms)){
  574. if(json_decode($user_info['shixin'])){
  575. $shixin = json_decode($user_info['shixin'],true);
  576. foreach ($shixin as $k => $v){
  577. if(array_key_exists('response',$v)){
  578. if(array_key_exists('path',$v['response'])){
  579. $shixin[$k]['url'] = $v['response']['path'];
  580. }
  581. }
  582. }
  583. }else{
  584. $shixin = [];
  585. }
  586. $user_info['shixin'] = $shixin;
  587. }
  588. //如果有声明书模块
  589. if(in_array('baokaoshengming',$forms)){
  590. if(json_decode($user_info['baokaoshengming'])){
  591. $baokaoshengming = json_decode($user_info['baokaoshengming'],true);
  592. foreach ($baokaoshengming as $k => $v){
  593. if(array_key_exists('response',$v)){
  594. if(array_key_exists('path',$v['response'])){
  595. $baokaoshengming[$k]['url'] = $v['response']['path'];
  596. }
  597. }
  598. }
  599. }else{
  600. $baokaoshengming = [];
  601. }
  602. $user_info['baokaoshengming'] = $baokaoshengming;
  603. }
  604. //获取最新的报名审核信息
  605. $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
  606. if($logs){
  607. $user_info['audit_log'] = $logs->log;
  608. }else{
  609. $user_info['audit_log'] = '';
  610. }
  611. //获取提交报名的次数
  612. // $number = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',3)->count();
  613. // $post_number = $number+1;//todo
  614. }
  615. }
  616. else{
  617. //实习专场
  618. if(in_array('internship',$forms)){
  619. $user_info = json_encode([
  620. 'recruit_id' => $id,
  621. 'operation' => 1,
  622. 'realname' => '',
  623. 'sex' => '1',
  624. 'birthday' => '',
  625. 'card' => '',
  626. 'nation' => '',
  627. 'native_place' => '',
  628. 'political_affiliation' => '',
  629. 'join_time' => '',
  630. 'house_register' => '',
  631. 'education' => '',
  632. 'school' => '',
  633. 'pro' => '',
  634. 'adjust' => '',
  635. 'mobile' => '',
  636. 'email' => '',
  637. 'address' => '',
  638. 'post_id' => '',
  639. 'concat_name' => '',
  640. 'concat_mobile' => '',
  641. 'resume' => '',
  642. 'avatar' => '',
  643. 'family' => [
  644. [
  645. 'relation' => '',
  646. 'realname' => '',
  647. 'birthday' => '',
  648. 'political_affiliation' => '',
  649. 'work' => ''
  650. ]
  651. ],
  652. 'detail' => [
  653. 'rewards_and_punishments' => '',
  654. 'introduce' => ''
  655. ],
  656. 'identification' => [],
  657. 'education_certification' => [],
  658. 'other_certification' => [],
  659. 'chengnuoshu' => [],
  660. 'baokaoshengming' => [],
  661. 'shixin' => []
  662. ]);
  663. }else{
  664. //如果没有,结合基础数据及模块表单信息,制作数据对象
  665. $user_info = RecruitAppointBasic::where('uid',$uid)->first();
  666. if(!$user_info){
  667. //没有基础信息跳转完善route('person.recruitInfo')
  668. return $this->showMessage('请先完善招考基础信息!', route('recruit.recruitInfo',array('recruit_id',$id)), true, '上一页', '3');
  669. }
  670. $user_info['sex'] = (string)$user_info['sex'];
  671. $user_info['edu_type'] = (string)$user_info['edu_type'];
  672. $user_info['family'] = json_decode($user_info['family']);
  673. if(in_array('expand_special',$forms)){
  674. $user_info['special'] = [
  675. 'point_apply' => '0',
  676. 'condition' => '',
  677. 'material' => []
  678. ];
  679. }
  680. if(in_array('detail',$forms)){
  681. $user_info['detail'] = [
  682. 'train' => '',
  683. 'rewards_and_punishments' => '',
  684. 'introduce' => ''
  685. ];
  686. }
  687. if(in_array('identification',$forms)){
  688. $user_info['identification'] = [];
  689. }
  690. if(in_array('education_certification',$forms)){
  691. $user_info['education_certification'] = [];
  692. }
  693. if(in_array('other_certification',$forms)){
  694. $user_info['other_certification'] = [];
  695. }
  696. if(in_array('chengnuoshu',$forms)){
  697. $user_info['chengnuoshu'] = [];
  698. }
  699. if(in_array('shixin',$forms)){
  700. $user_info['shixin'] = [];
  701. }
  702. if(in_array('baokaoshengming',$forms)){
  703. $user_info['baokaoshengming'] = [];
  704. }
  705. $user_info['recruit_id'] = $id;
  706. $user_info['operation'] = 1;
  707. }
  708. }
  709. //招考岗位
  710. $where_post[] = ['recruit_id', '=', $id];
  711. $where_post[] = ['status', '=', 1];
  712. $recruit_post = RecruitPost::where($where_post)->get();
  713. $post = [];
  714. $post_limit = [];
  715. foreach ($recruit_post as $value){
  716. $item = [
  717. 'value' => $value['id'],
  718. 'label' => $value['code'] . " " . $value['name']
  719. ];
  720. $post_limit[$value['id']] = json_decode($value['limit']);
  721. array_push($post,$item);
  722. }
  723. $view_data['appoint_info'] = $user_info;
  724. $view_data['post'] = json_encode($post);
  725. // $view_data['post_number'] = $post_number;
  726. // $view_data['post_times'] = $recruit['post_times'];
  727. $view_data['post_limit'] = json_encode($post_limit);
  728. $view_data['formDisable'] = $formDisabled;
  729. $view_data['title'] = $recruit->company;
  730. $view_data['special_condition_type'] = $recruit->special_condition_type;
  731. $view_data['special_condition_value'] = explode(',',$recruit->special_condition_value);
  732. return view('app.recruit.sign_up',$view_data);
  733. }
  734. public function preview(Request $request)
  735. {
  736. $modules = $request->input('modules');
  737. $view_data['module'] = $forms = explode(',', $modules);
  738. return view('app.recruit.preview',$view_data);
  739. }
  740. /**
  741. * 提交报名的处理程序
  742. * @param Request $request
  743. * @return array|\Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\think\response\Redirect|void
  744. */
  745. public function saveSignUp(Request $request)
  746. {
  747. $user = $this->getUser();
  748. if (!empty($user)) {
  749. $uid = $user->id;
  750. } else {
  751. return redirect(route('login'));
  752. }
  753. $recruit_id = $request->input('recruit_id', 0);
  754. if (!$recruit_id) {
  755. return response()->json(['status' => 0,'msg' => '请选择项目!']);
  756. }
  757. $recruit = Recruit::find($recruit_id);
  758. if(!$recruit['status']){
  759. return response()->json(['status' => 0,'msg' => '抱歉,该项目状态不正确,请联系客服!']);
  760. }
  761. if($recruit['current'] != 1 && $recruit['current'] != 2){
  762. return response()->json(['status' => 0,'msg' => '抱歉,该项目报名通道已关闭,如有疑问,请联系客服!']);
  763. }
  764. $card = $request->input('card');
  765. $appointinfo_exist = RecruitAppointInfo::where('card',$card)->where('uid','<>',$uid)->where('recruit_id',$recruit_id)->first();
  766. //兆丰建设两场公告二而一例外
  767. if($recruit_id == 25 || $recruit_id == 26){
  768. $special = RecruitAppointInfo::where('card',$card)->where('uid','<>',$uid)->whereIn('recruit_id',[25,26])->first();
  769. $appointinfo_exist = $appointinfo_exist & $special;
  770. }
  771. if($appointinfo_exist){
  772. return response()->json(['status' => 0,'msg' => '您的证件已有其他账号的报名记录,请检查!']);
  773. }
  774. $time = time();
  775. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  776. if(($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)){//过了招考时间
  777. if(!$appoint_info){
  778. return response()->json(['status' => 0,'msg' => '抱歉,该项目已过报名时间!']);
  779. }
  780. if(($time < strtotime($recruit['audit_start']) || strtotime($recruit['audit_end']) < $time)){//过了审核时间
  781. return response()->json(['status' => 0,'msg' => '抱歉,该项目已过审核时间,无法继续报名!']);
  782. }
  783. //如果有报名记录,先查询首次报名是什么时候
  784. $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->orderBy('created_at','asc')->first();
  785. if(!$first_post){//没有记录代表只是暂存
  786. return response()->json(['status' => 0,'msg' => '抱歉,该项目已过报名时间!']);
  787. }
  788. }
  789. $data = $request->only('realname','sex','birthday','avatar','nation','native_place','political_affiliation','titles','join_time','work','house_register','education','school','degree','pro','address','card','mobile','email','concat_name','concat_mobile','resume','post_id','adjust','remark','graduation');
  790. if(!array_key_exists('post_id',$data)){
  791. return response()->json(['status' => 0,'msg' => '请选择报考岗位']);
  792. }
  793. $post_info = RecruitPost::where('id',$data['post_id'])->where('recruit_id',$recruit_id)->first();
  794. if(!$post_info['status'] || $post_info['deleted_at'] != null){
  795. return response()->json(['status' => 0,'msg' => '该岗位已失效']);
  796. }
  797. //获取操作符,是暂存还是提交
  798. $operation = $request->input('operation');
  799. if($operation == 1){
  800. $data['audit'] = 0;//暂存
  801. }else{
  802. //基础信息的检查
  803. $rules = [
  804. 'realname' => 'required',
  805. 'sex' => 'required',
  806. 'birthday' => 'required',
  807. 'avatar' => 'required',
  808. 'nation' => 'required',
  809. 'native_place' => 'required',
  810. 'political_affiliation' => 'required',
  811. 'post_id' => 'required',
  812. 'house_register' => 'required',
  813. //'edu_type' => 'required',
  814. 'education' => 'required',
  815. 'school' => 'required',
  816. 'graduation' => 'required',
  817. 'address' => 'required',
  818. 'mobile' => 'required',
  819. 'email' => 'required',
  820. 'card' => 'required',
  821. 'concat_name' => 'required',
  822. 'concat_mobile' => 'required',
  823. 'resume' => 'required'
  824. ];
  825. $messages = [
  826. 'realname.required' => '请填写姓名',
  827. 'sex.required' => '请填写性别',
  828. 'birthday.required' => '请填写出生日期',
  829. 'avatar.required' => '请上传彩色免冠照',
  830. 'nation.required' => '请填写民族',
  831. 'native_place.required' => '请填写籍贯',
  832. 'political_affiliation.required' => '请选择政治面貌',
  833. 'post_id.required' => '请选择报名岗位',
  834. 'house_register.required' => '请填写户籍所在地',
  835. //'edu_type.required' => '请选择教育类型',
  836. 'education.required' => '请输入学历',
  837. 'school.required' => '请输入毕业院校',
  838. 'graduation.required' => '请填写毕业时间',
  839. 'address.required' => '请填写通信地址',
  840. 'mobile.required' => '请填写手机号码',
  841. 'email.required' => '请填写电子邮箱',
  842. 'card.required' => '请填写身份证号码',
  843. 'resume.required' => '请填写个人简历',
  844. 'concat_name.required' => '请填写联系人姓名',
  845. 'concat_mobile.required' => '请填写联系人手机号码'
  846. ];
  847. $create_data = $request->all();
  848. $validator = Validator::make($create_data,$rules,$messages);
  849. if ($validator->fails()) {
  850. $msg = $validator->errors()->all();
  851. return response()->json(['status' => 0,'msg' => $msg[0]]);
  852. }
  853. $data['audit'] = 1;//提交
  854. }
  855. if(strlen($data['card']) == 18){
  856. //身份证判断出生日期和性别
  857. $year = substr($data['card'],6,4);
  858. $month = substr($data['card'],10,2);
  859. $day = substr($data['card'],12,2);
  860. if($year.'-'.$month.'-'.$day != $data['birthday']){
  861. $data['birthday'] = $year.'-'.$month.'-'.$day;
  862. }
  863. if(intval(substr($data['card'],16,1)) % 2 == 0){
  864. $data['sex'] = 0;
  865. }else{
  866. $data['sex'] = 1;
  867. }
  868. }
  869. if(!empty($post_info['limit']) && json_decode($post_info['limit'])){
  870. //岗位限制条件的判断
  871. $post_limit = json_decode($post_info['limit'],true);
  872. if(is_array($post_limit)){
  873. foreach($post_limit as $k => $v){
  874. if($k == 'birthday'){
  875. $value = str_replace('-','',$data[$k]);
  876. }else{
  877. $value = $data[$k];
  878. }
  879. switch ($v['op']){
  880. case '=':
  881. if($value != $v['value']){
  882. return response()->json(['status' => 0,'msg' => $v['msg']]);
  883. }
  884. break;
  885. case '>':
  886. if($value <= $v['value']){
  887. return response()->json(['status' => 0,'msg' => $v['msg']]);
  888. }
  889. break;
  890. case '>=':
  891. if($value < $v['value']){
  892. return response()->json(['status' => 0,'msg' => $v['msg']]);
  893. }
  894. break;
  895. case '<':
  896. if($value >= $v['value']){
  897. return response()->json(['status' => 0,'msg' => $v['msg']]);
  898. }
  899. break;
  900. case '<=':
  901. if($value > $v['value']){
  902. return response()->json(['status' => 0,'msg' => $v['msg']]);
  903. }
  904. break;
  905. case '!=':
  906. if($value == $v['value']){
  907. return response()->json(['status' => 0,'msg' => $v['msg']]);
  908. }
  909. break;
  910. case 'like':
  911. if(strpos($value,$v['value']) === false){
  912. return response()->json(['status' => 0,'msg' => $v['msg']]);
  913. }
  914. break;
  915. case 'in':
  916. if(strpos($v['value'],$value) === false){
  917. return response()->json(['status' => 0,'msg' => $v['msg']]);
  918. }
  919. break;
  920. }
  921. }
  922. }
  923. }
  924. //前置审核 判断完成,先将数据入报名信息基础表
  925. //解析家庭成员数据
  926. $familys = $request->input('family');
  927. $family = [];
  928. if(is_array($familys)){
  929. foreach ($familys as $value){
  930. $item = [
  931. 'relation' => $value['relation'],
  932. 'realname' => $value['realname'],
  933. 'birthday' => $value['birthday'],
  934. 'political_affiliation' => $value['political_affiliation'],
  935. 'work' => $value['work']
  936. ];
  937. array_push($family,$item);
  938. }
  939. }
  940. $data['family'] = json_encode($family);
  941. if($appoint_info){
  942. //如果已有报名记录,进入修改阶段的处理流程
  943. DB::beginTransaction();
  944. try{
  945. RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->update($data);
  946. //分模块解析数据
  947. $forms = explode(',', $recruit['forms']);
  948. //如果有加分模块
  949. if(in_array('expand_special',$forms)){
  950. $special = $request->input('special');
  951. if($special['point_apply']){
  952. //删除掉没有成功返回路径的图片
  953. if(is_array($special['material'])){
  954. foreach ($special['material'] as $k => $v){
  955. if(!array_key_exists('response',$v)){
  956. unset($special['material'][$k]);
  957. }
  958. }
  959. }
  960. $special['material'] = json_encode($special['material']);
  961. }else{
  962. $special['condition'] = '';
  963. $special['material'] = json_encode([]);
  964. }
  965. $hasRecord = RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->first();
  966. if($hasRecord){
  967. RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->update($special);
  968. }else{
  969. $special['recruit_appoint_id'] = $appoint_info->id;
  970. RecruitAppointExpandSpecial::create($special);
  971. }
  972. }
  973. //如果有详情模块
  974. if(in_array('detail',$forms) || in_array('internship',$forms)){
  975. $detail = $request->input('detail');
  976. $hasRecord = RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->first();
  977. if($hasRecord){
  978. RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->update($detail);
  979. }else{
  980. $detail['recruit_appoint_id'] = $appoint_info->id;
  981. RecruitAppointDetail::create($detail);
  982. }
  983. }
  984. //如果有身份证明模块
  985. if(in_array('identification',$forms) || in_array('internship',$forms)){
  986. $identification = $request->input('identification');
  987. if(is_array($identification)){
  988. //删除掉没有成功返回路径的图片
  989. foreach ($identification as $k => $v){
  990. if(!array_key_exists('response',$v)){
  991. unset($identification[$k]);
  992. }
  993. }
  994. }
  995. $appoint_info->identification = json_encode($identification);
  996. $appoint_info->save();
  997. }
  998. //如果有教育证明模块
  999. if(in_array('education_certification',$forms) || in_array('internship',$forms)){
  1000. $education_certification = $request->input('education_certification');
  1001. if(is_array($education_certification)){
  1002. //删除掉没有成功返回路径的图片
  1003. foreach ($education_certification as $k => $v){
  1004. if(!array_key_exists('response',$v)){
  1005. unset($education_certification[$k]);
  1006. }
  1007. }
  1008. }
  1009. $appoint_info->education_certification = json_encode($education_certification);
  1010. $appoint_info->save();
  1011. }
  1012. //如果有其他证明模块
  1013. if(in_array('other_certification',$forms) || in_array('internship',$forms)){
  1014. $other_certification = $request->input('other_certification');
  1015. if(is_array($other_certification)){
  1016. //删除掉没有成功返回路径的图片
  1017. foreach ($other_certification as $k => $v){
  1018. if(!array_key_exists('response',$v)){
  1019. unset($other_certification[$k]);
  1020. }
  1021. }
  1022. }
  1023. if($other_certification){
  1024. $appoint_info->other_certification = json_encode($other_certification);
  1025. $appoint_info->save();
  1026. }
  1027. }
  1028. //如果有承诺书模块
  1029. if(in_array('chengnuoshu',$forms)){
  1030. $chengnuoshu = $request->input('chengnuoshu');
  1031. if(is_array($chengnuoshu)){
  1032. //删除掉没有成功返回路径的图片
  1033. foreach ($chengnuoshu as $k => $v){
  1034. if(!array_key_exists('response',$v)){
  1035. unset($chengnuoshu[$k]);
  1036. }
  1037. }
  1038. }
  1039. if($chengnuoshu){
  1040. $appoint_info->chengnuoshu = json_encode($chengnuoshu);
  1041. $appoint_info->save();
  1042. }
  1043. }
  1044. //如果有失信被执行人模块
  1045. if(in_array('shixin',$forms)){
  1046. $shixin = $request->input('shixin');
  1047. if(is_array($shixin)){
  1048. //删除掉没有成功返回路径的图片
  1049. foreach ($shixin as $k => $v){
  1050. if(!array_key_exists('response',$v)){
  1051. unset($shixin[$k]);
  1052. }
  1053. }
  1054. }
  1055. if($shixin){
  1056. $appoint_info->shixin = json_encode($shixin);
  1057. $appoint_info->save();
  1058. }
  1059. }
  1060. //如果有声明书模块
  1061. if(in_array('baokaoshengming',$forms)){
  1062. $baokaoshengming = $request->input('baokaoshengming');
  1063. if(is_array($baokaoshengming)){
  1064. //删除掉没有成功返回路径的图片
  1065. foreach ($baokaoshengming as $k => $v){
  1066. if(!array_key_exists('response',$v)){
  1067. unset($baokaoshengming[$k]);
  1068. }
  1069. }
  1070. }
  1071. if($baokaoshengming){
  1072. $appoint_info->baokaoshengming = json_encode($baokaoshengming);
  1073. $appoint_info->save();
  1074. }
  1075. }
  1076. DB::commit();
  1077. if($operation == 2){
  1078. $log = [
  1079. 'type' => 3,
  1080. 'appoint_id'=> $appoint_info->id,
  1081. 'uid' => $uid,
  1082. 'log' => '用户提交报名'
  1083. ];
  1084. RecruitAppointLog::create($log);
  1085. return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id];
  1086. }else{
  1087. return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $appoint_info->id];
  1088. }
  1089. } catch (\Exception $e){
  1090. DB::rollback();
  1091. return ['status' => 0, 'msg' => $e->getMessage()];
  1092. }
  1093. }else{
  1094. //没有报名记录,进入增加阶段的处理流程
  1095. DB::beginTransaction();
  1096. try{
  1097. //20220726增加地区undefined选项处理
  1098. if($index = stripos($data['native_place'],',undefined')){
  1099. $data['native_place'] = substr($data['native_place'],0,$index);
  1100. }
  1101. if($index = stripos($data['house_register'],',undefined')){
  1102. $data['house_register'] = substr($data['house_register'],0,$index);
  1103. }
  1104. $data['uid'] = $uid;
  1105. $data['recruit_id'] = $recruit_id;
  1106. $result = RecruitAppointInfo::create($data);
  1107. //分模块解析数据
  1108. $forms = explode(',', $recruit['forms']);
  1109. //如果有加分模块
  1110. if(in_array('expand_special',$forms)){
  1111. $special = $request->input('special');
  1112. if($special['point_apply']){
  1113. if(is_array($special['material'])){
  1114. //删除掉没有成功返回路径的图片
  1115. foreach ($special['material'] as $k => $v){
  1116. if(!array_key_exists('response',$v)){
  1117. unset($special['material'][$k]);
  1118. }
  1119. }
  1120. }
  1121. $special['material'] = json_encode($special['material']);
  1122. }
  1123. $special['recruit_appoint_id'] = $result->id;
  1124. RecruitAppointExpandSpecial::create($special);
  1125. }
  1126. //如果有详情模块
  1127. if(in_array('detail',$forms) || in_array('internship',$forms)){
  1128. $detail = $request->input('detail');
  1129. $detail['recruit_appoint_id'] = $result->id;
  1130. RecruitAppointDetail::create($detail);
  1131. }
  1132. //如果有身份证明模块
  1133. if(in_array('identification',$forms) || in_array('internship',$forms)){
  1134. $identification = $request->input('identification');
  1135. if(is_array($identification)){
  1136. //删除掉没有成功返回路径的图片
  1137. foreach ($identification as $k => $v){
  1138. if(!array_key_exists('response',$v)){
  1139. unset($identification[$k]);
  1140. }
  1141. }
  1142. }
  1143. $result->identification = json_encode($identification);
  1144. $result->save();
  1145. }
  1146. //如果有教育证明模块
  1147. if(in_array('education_certification',$forms) || in_array('internship',$forms)){
  1148. $education_certification = $request->input('education_certification');
  1149. if(is_array($education_certification)){
  1150. //删除掉没有成功返回路径的图片
  1151. foreach ($education_certification as $k => $v){
  1152. if(!array_key_exists('response',$v)){
  1153. unset($education_certification[$k]);
  1154. }
  1155. }
  1156. }
  1157. $result->education_certification = json_encode($education_certification);
  1158. $result->save();
  1159. }
  1160. //如果有其他证明模块
  1161. if(in_array('other_certification',$forms) || in_array('internship',$forms)){
  1162. $other_certification = $request->input('other_certification');
  1163. if($other_certification){
  1164. if(is_array($other_certification)){
  1165. //删除掉没有成功返回路径的图片
  1166. foreach ($other_certification as $k => $v){
  1167. if(!array_key_exists('response',$v)){
  1168. unset($other_certification[$k]);
  1169. }
  1170. }
  1171. }
  1172. $result->other_certification = json_encode($other_certification);
  1173. $result->save();
  1174. }
  1175. }
  1176. //如果有承诺书模块
  1177. if(in_array('chengnuoshu',$forms)){
  1178. $chengnuoshu = $request->input('chengnuoshu');
  1179. if($chengnuoshu){
  1180. if(is_array($chengnuoshu)){
  1181. //删除掉没有成功返回路径的图片
  1182. foreach ($chengnuoshu as $k => $v){
  1183. if(!array_key_exists('response',$v)){
  1184. unset($chengnuoshu[$k]);
  1185. }
  1186. }
  1187. }
  1188. $result->chengnuoshu = json_encode($chengnuoshu);
  1189. $result->save();
  1190. }
  1191. }
  1192. //如果有失信被执行人模块
  1193. if(in_array('shixin',$forms)){
  1194. $shixin = $request->input('shixin');
  1195. if($shixin){
  1196. if(is_array($shixin)){
  1197. //删除掉没有成功返回路径的图片
  1198. foreach ($shixin as $k => $v){
  1199. if(!array_key_exists('response',$v)){
  1200. unset($shixin[$k]);
  1201. }
  1202. }
  1203. }
  1204. $result->shixin = json_encode($shixin);
  1205. $result->save();
  1206. }
  1207. }
  1208. //如果有声明书模块
  1209. if(in_array('baokaoshengming',$forms)){
  1210. $baokaoshengming = $request->input('baokaoshengming');
  1211. if($baokaoshengming){
  1212. if(is_array($baokaoshengming)){
  1213. //删除掉没有成功返回路径的图片
  1214. foreach ($baokaoshengming as $k => $v){
  1215. if(!array_key_exists('response',$v)){
  1216. unset($baokaoshengming[$k]);
  1217. }
  1218. }
  1219. }
  1220. $result->baokaoshengming = json_encode($baokaoshengming);
  1221. $result->save();
  1222. }
  1223. }
  1224. DB::commit();
  1225. if($operation == 2){
  1226. $log = [
  1227. 'type' => 3,
  1228. 'appoint_id'=> $result->id,
  1229. 'uid' => $uid,
  1230. 'log' => '用户首次提交报名'
  1231. ];
  1232. RecruitAppointLog::create($log);
  1233. return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
  1234. }else{
  1235. return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $result->id];
  1236. }
  1237. } catch (\Exception $e){
  1238. DB::rollback();
  1239. return ['status' => 0, 'msg' => $e->getMessage()];
  1240. }
  1241. }
  1242. }
  1243. /**
  1244. * 获得当前登录的用户
  1245. * @return \Illuminate\Contracts\Auth\Authenticatable|null
  1246. */
  1247. public function getUser()
  1248. {
  1249. if (auth('web-member')->check()) {
  1250. $user = auth('web-member')->user();
  1251. } else {
  1252. $user = null;
  1253. }
  1254. return $user;
  1255. }
  1256. /**
  1257. * 检查用户基本信息
  1258. * @return array
  1259. */
  1260. public function checkUserBasicInfo()
  1261. {
  1262. $user = $this->getUser();
  1263. if (!empty($user)) {
  1264. $uid = $user->id;
  1265. } else {
  1266. $arr = ['status' => 401, 'msg'=>'请登录!'];
  1267. return $arr;
  1268. }
  1269. $info = RecruitAppointBasic::where('uid',$uid)->first();
  1270. if (empty($info)){
  1271. $arr = ['status'=>401,'msg'=>'请先完善招考基本信息','url'=> route('recruit.recruitInfo')];
  1272. return $arr;
  1273. }
  1274. return ['status' => 200, 'msg' => ''];
  1275. }
  1276. /**
  1277. * 个人中心招考页面
  1278. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed|\think\response\View
  1279. */
  1280. public function person_recruit()
  1281. {
  1282. $user = auth('web-member')->user();
  1283. $list = RecruitAppointInfo::where('uid',$user->id)
  1284. ->join('recruit', 'recruit.id', '=', 'recruit_appoint_info.recruit_id', 'left')
  1285. ->join('recruit_post', 'recruit_post.id', '=', 'recruit_appoint_info.post_id', 'left')
  1286. ->select('recruit.name as recruit_name','recruit_appoint_info.*','recruit_post.code','recruit_post.name')
  1287. ->get();
  1288. return view('app.person.recruit')->with(['list' => $list,'total' => count($list)]);
  1289. }
  1290. /**
  1291. * 招考信息基础页
  1292. * @param Request $request
  1293. * @return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed|\think\response\View
  1294. */
  1295. public function recruit_info(Request $request)
  1296. {
  1297. $user = auth('web-member')->user();
  1298. if (!empty($user)) {
  1299. $uid = $user->id;
  1300. } else {
  1301. return redirect(route('login'));
  1302. }
  1303. $info = RecruitAppointBasic::where('uid',$user->id)->first();
  1304. if(!$info){
  1305. $info = [
  1306. 'realname' => '',
  1307. 'sex' => '0',
  1308. 'birthday' => '',
  1309. 'avatar' => '',
  1310. 'nation' => '',
  1311. 'native_place' => '',
  1312. 'political_affiliation' => '',
  1313. 'titles' => '',
  1314. 'work' => '',
  1315. 'house_register' => '',
  1316. 'join_time' => '',
  1317. 'edu_type' => '',
  1318. 'education' => '',
  1319. 'school' => '',
  1320. 'degree' => '',
  1321. 'pro' => '',
  1322. 'address' => '',
  1323. 'card' => '',
  1324. 'mobile' => '',
  1325. 'email' => '',
  1326. 'concat_name' => '',
  1327. 'concat_mobile' => '',
  1328. 'resume' => '',
  1329. 'family' => [
  1330. [
  1331. 'relation' => '',
  1332. 'realname' => '',
  1333. 'birthday' => '',
  1334. 'political_affiliation' => '',
  1335. 'work' => ''
  1336. ]
  1337. ],
  1338. 'is_push' => '1'
  1339. ];
  1340. }else{
  1341. $info->sex = (string)$info->sex;
  1342. $info->edu_type = (string)$info->edu_type;
  1343. $info->is_push = (string)$info->is_push;
  1344. $info->family = empty($info->family) ? [[
  1345. 'relation' => '',
  1346. 'realname' => '',
  1347. 'birthday' => '',
  1348. 'political_affiliation' => '',
  1349. 'work' => ''
  1350. ]] : json_decode($info->family);
  1351. }
  1352. $recruit_id = $request->input('recruit_id',0);
  1353. return view('app.person.recruit_info',[
  1354. 'info' => json_encode($info),
  1355. 'recruit_id'=> $recruit_id
  1356. ]);
  1357. }
  1358. /**
  1359. * 保存招考信息
  1360. * @param RecruitValidatorRequest $request
  1361. * @return \Illuminate\Http\JsonResponse
  1362. */
  1363. public function saveRecruitInfo(RecruitValidatorRequest $request)
  1364. {
  1365. $user = auth('web-member')->user();
  1366. $basic = RecruitAppointBasic::where('uid',$user->id)->first();
  1367. $data = $request->only('realname','sex','birthday','avatar','nation','native_place','political_affiliation','titles','work','house_register','join_time','education','school','degree','pro','address','card','mobile','email','concat_name','concat_mobile','resume','family','is_push');
  1368. if(count($data['family']) > 0){
  1369. $data['family'] = json_encode($data['family']);
  1370. }
  1371. if($basic){
  1372. //更新基础信息
  1373. $res = RecruitAppointBasic::where('uid',$user->id)->update($data);
  1374. if (!$res) {
  1375. return response()->json(['status'=>0,'msg'=>'保存失败,请联系客服']);
  1376. }else{
  1377. return response()->json(['status'=>1,'msg'=>'个人基础信息保存成功,快去报名吧!']);
  1378. }
  1379. }else{
  1380. //新增基础信息
  1381. $data['uid'] = $user->id;
  1382. $res = RecruitAppointBasic::create($data);
  1383. if (!$res) {
  1384. return response()->json(['status'=>0,'msg'=>'保存失败,请联系客服']);
  1385. }else{
  1386. return response()->json(['status'=>1,'msg'=>'个人基础信息保存成功,快去报名吧!']);
  1387. }
  1388. }
  1389. }
  1390. /**
  1391. * 笔试准考证
  1392. * @param Request $request
  1393. * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  1394. */
  1395. public function pen_ticket(Request $request)
  1396. {
  1397. $user = $this->getUser();
  1398. if (!empty($user)) {
  1399. $uid = $user->id;
  1400. } else {
  1401. return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
  1402. }
  1403. $recruit_id = $request->input('recruit_id');
  1404. $recruit = Recruit::where('id',$recruit_id)->first();
  1405. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  1406. if($appoint_info){
  1407. $pen_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',1)->first();
  1408. if($pen_ticket){
  1409. $health = RecruitSupplement::where('appoint_id',$appoint_info->id)->first();
  1410. if((!$health || $health->h_status == 0) && $recruit->pen_epidemic){
  1411. return $this->showMessage('健康审核信息未通过!', route('home'), true, '上一页', '3');
  1412. }
  1413. $time = time();
  1414. if(strtotime($pen_ticket->ex_start) < $time && strtotime($pen_ticket->ex_end) > $time){
  1415. RecruitTicket::where('appoint_id',$appoint_info->id)->update(['ex_status' => 1]);
  1416. $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
  1417. $name = $recruit->name_en;
  1418. $date = date("Y-m-d",strtotime($recruit->created_at));
  1419. //$filename = $date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id];
  1420. $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
  1421. $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/pen/" . $filename . '.pdf';
  1422. if(file_exists($file)){
  1423. header('Content-Description: File Transfer');
  1424. header('Content-Type: application/octet-stream');
  1425. header('Content-Disposition: attachment; filename='.basename($file));
  1426. header('Content-Transfer-Encoding: binary');
  1427. header('Expires: 0');
  1428. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  1429. header('Pragma: public');
  1430. header('Content-Length: ' . filesize($file));
  1431. ob_clean(); //重要的就是这个函数的调用, 清空但不关闭输出缓存, 否则下载的文件头两个字符会是0a
  1432. flush();
  1433. readfile($file);
  1434. }else{
  1435. return $this->showMessage('准考证不存在,请联系管理员!', route('home'), true, '上一页', '3');
  1436. }
  1437. }else{
  1438. return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
  1439. }
  1440. }else{
  1441. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1442. }
  1443. }else{
  1444. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1445. }
  1446. }
  1447. /**
  1448. * 审核准考证
  1449. * @param Request $request
  1450. * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  1451. */
  1452. public function check_ticket(Request $request)
  1453. {
  1454. $user = $this->getUser();
  1455. if (!empty($user)) {
  1456. $uid = $user->id;
  1457. } else {
  1458. return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
  1459. }
  1460. $recruit_id = $request->input('recruit_id');
  1461. $recruit = Recruit::where('id',$recruit_id)->first();
  1462. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  1463. if($appoint_info){
  1464. $check_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',2)->first();
  1465. if($check_ticket){
  1466. $health = RecruitSupplement::where('appoint_id',$appoint_info->id)->first();
  1467. if((!$health || $health->h_status == 0) && $recruit->pen_epidemic){
  1468. return $this->showMessage('健康审核信息未通过!', route('home'), true, '上一页', '3');
  1469. }$time = time();
  1470. if(strtotime($check_ticket->ex_start) < $time && strtotime($check_ticket->ex_end) > $time){
  1471. RecruitTicket::where('id',$check_ticket->id)->update(['ex_status' => 1]);
  1472. $recruit = Recruit::where('id',$recruit_id)->first();
  1473. $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
  1474. $name = $recruit->name_en;
  1475. $date = date("Y-m-d",strtotime($recruit->created_at));
  1476. //$filename = $date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id];
  1477. $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
  1478. $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/computer/" . $filename . '.pdf';
  1479. if(file_exists($file)){
  1480. header('Content-Description: File Transfer');
  1481. header('Content-Type: application/octet-stream');
  1482. header('Content-Disposition: attachment; filename='.basename($file));
  1483. header('Content-Transfer-Encoding: binary');
  1484. header('Expires: 0');
  1485. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  1486. header('Pragma: public');
  1487. header('Content-Length: ' . filesize($file));
  1488. ob_clean(); //重要的就是这个函数的调用, 清空但不关闭输出缓存, 否则下载的文件头两个字符会是0a
  1489. flush();
  1490. readfile($file);
  1491. }
  1492. }else{
  1493. return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
  1494. }
  1495. }else{
  1496. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1497. }
  1498. }else{
  1499. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1500. }
  1501. }
  1502. /**
  1503. * 面试准考证
  1504. * @param Request $request
  1505. * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  1506. */
  1507. public function face_ticket(Request $request)
  1508. {
  1509. $user = $this->getUser();
  1510. if (!empty($user)) {
  1511. $uid = $user->id;
  1512. } else {
  1513. return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
  1514. }
  1515. $recruit_id = $request->input('recruit_id');
  1516. $recruit = Recruit::where('id',$recruit_id)->first();
  1517. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  1518. if($appoint_info){
  1519. $face_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',3)->first();
  1520. if($face_ticket){
  1521. $health = RecruitSupplement::where('appoint_id',$appoint_info->id)->first();
  1522. if((!$health || $health->h_status == 0) && $recruit->pen_epidemic){
  1523. return $this->showMessage('健康审核信息未通过!', route('home'), true, '上一页', '3');
  1524. }$time = time();
  1525. if(strtotime($face_ticket->ex_start) < $time && strtotime($face_ticket->ex_end) > $time){
  1526. RecruitTicket::where('id',$face_ticket->id)->update(['ex_status' => 1]);
  1527. $recruit = Recruit::where('id',$recruit_id)->first();
  1528. $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
  1529. $name = $recruit->name_en;
  1530. $date = date("Y-m-d",strtotime($recruit->created_at));
  1531. //$filename = $date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id];
  1532. $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
  1533. $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/face/" . $filename . '.pdf';
  1534. if(file_exists($file)){
  1535. header('Content-Description: File Transfer');
  1536. header('Content-Type: application/octet-stream');
  1537. header('Content-Disposition: attachment; filename='.basename($file));
  1538. header('Content-Transfer-Encoding: binary');
  1539. header('Expires: 0');
  1540. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  1541. header('Pragma: public');
  1542. header('Content-Length: ' . filesize($file));
  1543. ob_clean(); //重要的就是这个函数的调用, 清空但不关闭输出缓存, 否则下载的文件头两个字符会是0a
  1544. flush();
  1545. readfile($file);
  1546. }
  1547. }else{
  1548. return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
  1549. }
  1550. }else{
  1551. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1552. }
  1553. }else{
  1554. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1555. }
  1556. }
  1557. /**
  1558. * 复试准考证
  1559. * @param Request $request
  1560. * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  1561. */
  1562. public function reexamine_ticket(Request $request)
  1563. {
  1564. $user = $this->getUser();
  1565. if (!empty($user)) {
  1566. $uid = $user->id;
  1567. } else {
  1568. return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
  1569. }
  1570. $recruit_id = $request->input('recruit_id');
  1571. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  1572. if($appoint_info){
  1573. $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
  1574. if($reexamine_ticket){
  1575. $time = time();
  1576. if(strtotime($reexamine_ticket->ex_start) < $time && strtotime($reexamine_ticket->ex_end) > $time){
  1577. RecruitTicket::where('id',$reexamine_ticket->id)->update(['ex_status' => 1]);
  1578. $recruit = Recruit::where('id',$recruit_id)->first();
  1579. $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
  1580. $name = $recruit->name_en;
  1581. $date = date("Y-m-d",strtotime($recruit->created_at));
  1582. $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
  1583. $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/reexamine/" . $filename . '.pdf';
  1584. if(file_exists($file)){
  1585. header('Content-Description: File Transfer');
  1586. header('Content-Type: application/octet-stream');
  1587. header('Content-Disposition: attachment; filename='.basename($file));
  1588. header('Content-Transfer-Encoding: binary');
  1589. header('Expires: 0');
  1590. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  1591. header('Pragma: public');
  1592. header('Content-Length: ' . filesize($file));
  1593. ob_clean(); //重要的就是这个函数的调用, 清空但不关闭输出缓存, 否则下载的文件头两个字符会是0a
  1594. flush();
  1595. readfile($file);
  1596. }
  1597. }else{
  1598. return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
  1599. }
  1600. }else{
  1601. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1602. }
  1603. }else{
  1604. return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
  1605. }
  1606. }
  1607. /**
  1608. * 材料补登
  1609. * @param Request $request
  1610. */
  1611. public function material_supplement(Request $request)
  1612. {
  1613. $user = $this->getUser();
  1614. if (!empty($user)) {
  1615. $uid = $user->id;
  1616. } else {
  1617. return redirect(route('login'));
  1618. }
  1619. //招考id
  1620. $id = $request->input('id', 0);
  1621. if (!$id) {
  1622. return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
  1623. }
  1624. $recruit = Recruit::find($id);
  1625. if(!$recruit['status'] && !$user->recruit_test){
  1626. return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1627. }
  1628. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  1629. if(!$appoint_info){
  1630. return $this->showMessage('抱歉,您没有报名,无需考察审核!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1631. }
  1632. if($appoint_info->pen_audit != 1){
  1633. return $this->showMessage('抱歉,您未入闱,无需考察审核!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1634. }
  1635. $limit_time = 1662543000;
  1636. $time = time();
  1637. if( $time > $limit_time){
  1638. return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1639. }
  1640. $info = RecruitSupplement::where('appoint_id',$appoint_info->id)->where('type','supplement')->first();
  1641. if(!$info){
  1642. $info = [
  1643. 'appoint_id' => $appoint_info->id,
  1644. 'identification' => '',
  1645. 'household_register' => '',
  1646. 'education_certification' => '',
  1647. //'family_planning' => '',
  1648. 'manage' => '',
  1649. 'status' => 3
  1650. ];
  1651. }else{
  1652. $info = $info->toArray();
  1653. if(json_decode($info['identification'])){
  1654. $identification = json_decode($info['identification'],true);
  1655. foreach ($identification as $k => $v){
  1656. if(array_key_exists('response',$v)){
  1657. $identification[$k]['url'] = $v['response']['path'];
  1658. }
  1659. }
  1660. }else{
  1661. $identification = [];
  1662. }
  1663. $info['identification'] = $identification;
  1664. if(json_decode($info['household_register'])){
  1665. $household_register = json_decode($info['household_register'],true);
  1666. foreach ($household_register as $k => $v){
  1667. if(array_key_exists('response',$v)){
  1668. $household_register[$k]['url'] = $v['response']['path'];
  1669. }
  1670. }
  1671. }else{
  1672. $household_register = [];
  1673. }
  1674. $info['household_register'] = $household_register;
  1675. if(json_decode($info['education_certification'])){
  1676. $education_certification = json_decode($info['education_certification'],true);
  1677. foreach ($education_certification as $k => $v){
  1678. if(array_key_exists('response',$v)){
  1679. $education_certification[$k]['url'] = $v['response']['path'];
  1680. }
  1681. }
  1682. }else{
  1683. $education_certification = [];
  1684. }
  1685. $info['education_certification'] = $education_certification;
  1686. if(json_decode($info['family_planning'])){
  1687. $family_planning = json_decode($info['family_planning'],true);
  1688. foreach ($family_planning as $k => $v){
  1689. if(array_key_exists('response',$v)){
  1690. $family_planning[$k]['url'] = $v['response']['path'];
  1691. }
  1692. }
  1693. }else{
  1694. $family_planning = [];
  1695. }
  1696. $info['family_planning'] = $family_planning;
  1697. if(json_decode($info['manage'])){
  1698. $manage = json_decode($info['manage'],true);
  1699. foreach ($manage as $k => $v){
  1700. if(array_key_exists('response',$v)){
  1701. $manage[$k]['url'] = $v['response']['path'];
  1702. }
  1703. }
  1704. }else{
  1705. $manage = [];
  1706. }
  1707. $info['manage'] = $manage;
  1708. }
  1709. $view_data['info'] = json_encode($info);
  1710. $view_data['title'] = $recruit->company;
  1711. return view('app.recruit.supplement',$view_data);
  1712. }
  1713. /**
  1714. * 健康信息登记
  1715. * @param Request $request
  1716. */
  1717. public function health_info(Request $request)
  1718. {
  1719. $user = $this->getUser();
  1720. if (!empty($user)) {
  1721. $uid = $user->id;
  1722. } else {
  1723. return redirect(route('login'));
  1724. }
  1725. //招考id
  1726. $id = $request->input('id', 0);
  1727. if (!$id) {
  1728. return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
  1729. }
  1730. $recruit = Recruit::find($id);
  1731. if(!$recruit['status'] && !$user->recruit_test){
  1732. return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1733. }
  1734. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  1735. if(!$appoint_info){
  1736. return $this->showMessage('抱歉,您没有报名,无需登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1737. }
  1738. if($appoint_info->audit != 3){
  1739. return $this->showMessage('抱歉,您无需登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1740. }
  1741. $time = time();
  1742. $type = $request->input('type',null);
  1743. $where = [];
  1744. if($type){
  1745. switch ($type){
  1746. case 'pen':
  1747. $start = strtotime($recruit->pen_health_start);
  1748. $end = strtotime($recruit->pen_health_end);
  1749. break;
  1750. case 'computer':
  1751. $start = strtotime($recruit->computer_health_start);
  1752. $end = strtotime($recruit->computer_health_end);
  1753. break;
  1754. case 'face':
  1755. $start = strtotime($recruit->face_health_start);
  1756. $end = strtotime($recruit->face_health_end);
  1757. break;
  1758. case 'reexamine':
  1759. $start = strtotime($recruit->reexamine_health_start);
  1760. $end = strtotime($recruit->reexamine_health_end);
  1761. break;
  1762. default:
  1763. $start = strtotime($recruit->supplement_start);
  1764. $end = strtotime($recruit->supplement_end);
  1765. break;
  1766. }
  1767. $where[] = ['type', '=', $type];
  1768. }else{
  1769. $start = strtotime($recruit->supplement_start);
  1770. $end = strtotime($recruit->supplement_end);
  1771. }
  1772. if($time > $end || $time < $start){
  1773. return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  1774. }
  1775. $where[] = ['appoint_id', '=', $appoint_info->id];
  1776. $info = RecruitSupplement::where($where)->first();
  1777. if(!$info){
  1778. $info = [
  1779. 'appoint_id' => $appoint_info->id,
  1780. 'health_code' => '',
  1781. 'trip_code' => '',
  1782. 'type' => $type
  1783. ];
  1784. }else{
  1785. $info = $info->toArray();
  1786. if(json_decode($info['health_code'])){
  1787. $health_code = json_decode($info['health_code'],true);
  1788. foreach ($health_code as $k => $v){
  1789. if(array_key_exists('response',$v)){
  1790. $health_code[$k]['url'] = $v['response']['path'];
  1791. }
  1792. }
  1793. }else{
  1794. $health_code = [];
  1795. }
  1796. $info['health_code'] = $health_code;
  1797. if(json_decode($info['trip_code'])){
  1798. $trip_code = json_decode($info['trip_code'],true);
  1799. foreach ($trip_code as $k => $v){
  1800. if(array_key_exists('response',$v)){
  1801. $trip_code[$k]['url'] = $v['response']['path'];
  1802. }
  1803. }
  1804. }else{
  1805. $trip_code = [];
  1806. }
  1807. $info['trip_code'] = $trip_code;
  1808. }
  1809. $view_data['info'] = json_encode($info);
  1810. $view_data['title'] = $recruit->company;
  1811. return view('app.recruit.health',$view_data);
  1812. }
  1813. public function save_supplement(Request $request)
  1814. {
  1815. $user = $this->getUser();
  1816. if (!empty($user)) {
  1817. $uid = $user->id;
  1818. } else {
  1819. return redirect(route('login'));
  1820. }
  1821. $limit_time = 1662543000;
  1822. $time = time();
  1823. if( $time > $limit_time){
  1824. return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',18)), true, '上一页', '3');
  1825. }
  1826. $appoint_id = $request->input('appoint_id');
  1827. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',18)->where('id',$appoint_id)->first();
  1828. if(!$appoint_info){
  1829. return ['status' => 0, 'msg' => '抱歉,找不到您要补登的报名记录!'];
  1830. }
  1831. $info = RecruitSupplement::where('appoint_id',$appoint_id)->where('type','supplement')->first();
  1832. if($info){
  1833. if($info->status == 1){
  1834. return ['status' => 0, 'msg' => '材料已审核通过,不允许修改'];
  1835. }
  1836. if($info->status == 0){
  1837. return ['status' => 0, 'msg' => '材料审核中,不允许修改'];
  1838. }
  1839. //身份证明
  1840. $identification = $request->input('identification');
  1841. if(is_array($identification)){
  1842. //删除掉没有成功返回路径的图片
  1843. foreach ($identification as $k => $v){
  1844. if(!array_key_exists('response',$v)){
  1845. unset($identification[$k]);
  1846. }
  1847. }
  1848. }
  1849. $info->identification = json_encode($identification);
  1850. //户口簿
  1851. $household_register = $request->input('household_register');
  1852. if(is_array($household_register)){
  1853. //删除掉没有成功返回路径的图片
  1854. foreach ($household_register as $k => $v){
  1855. if(!array_key_exists('response',$v)){
  1856. unset($household_register[$k]);
  1857. }
  1858. }
  1859. }
  1860. $info->household_register = json_encode($household_register);
  1861. //学信网
  1862. $education_certification = $request->input('education_certification');
  1863. if(is_array($education_certification)){
  1864. //删除掉没有成功返回路径的图片
  1865. foreach ($education_certification as $k => $v){
  1866. if(!array_key_exists('response',$v)){
  1867. unset($education_certification[$k]);
  1868. }
  1869. }
  1870. }
  1871. $info->education_certification = json_encode($education_certification);
  1872. //计生
  1873. // $family_planning = $request->input('family_planning');
  1874. // if(is_array($family_planning)){
  1875. // //删除掉没有成功返回路径的图片
  1876. // foreach ($family_planning as $k => $v){
  1877. // if(!array_key_exists('response',$v)){
  1878. // unset($family_planning[$k]);
  1879. // }
  1880. // }
  1881. // }
  1882. // $info->family_planning = json_encode($family_planning);
  1883. //综治
  1884. $manage = $request->input('manage');
  1885. if(is_array($manage)){
  1886. //删除掉没有成功返回路径的图片
  1887. foreach ($manage as $k => $v){
  1888. if(!array_key_exists('response',$v)){
  1889. unset($manage[$k]);
  1890. }
  1891. }
  1892. }
  1893. $info->manage = json_encode($manage);
  1894. $info->status = 0;
  1895. $info->save();
  1896. $appoint_info->political_audit = 4;
  1897. $appoint_info->save();
  1898. return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
  1899. }else{
  1900. $data['appoint_id'] = $appoint_id;
  1901. //身份证明
  1902. $identification = $request->input('identification');
  1903. if(is_array($identification)){
  1904. //删除掉没有成功返回路径的图片
  1905. foreach ($identification as $k => $v){
  1906. if(!array_key_exists('response',$v)){
  1907. unset($identification[$k]);
  1908. }
  1909. }
  1910. }
  1911. $data['identification'] = json_encode($identification);
  1912. //户口簿
  1913. $household_register = $request->input('household_register');
  1914. if(is_array($household_register)){
  1915. //删除掉没有成功返回路径的图片
  1916. foreach ($household_register as $k => $v){
  1917. if(!array_key_exists('response',$v)){
  1918. unset($household_register[$k]);
  1919. }
  1920. }
  1921. }
  1922. $data['household_register'] = json_encode($household_register);
  1923. //学信网
  1924. $education_certification = $request->input('education_certification');
  1925. if(is_array($education_certification)){
  1926. //删除掉没有成功返回路径的图片
  1927. foreach ($education_certification as $k => $v){
  1928. if(!array_key_exists('response',$v)){
  1929. unset($education_certification[$k]);
  1930. }
  1931. }
  1932. }
  1933. $data['education_certification'] = json_encode($education_certification);
  1934. //计生
  1935. // $family_planning = $request->input('family_planning');
  1936. // if(is_array($family_planning)){sp
  1937. // //删除掉没有成功返回路径的图片
  1938. // foreach ($family_planning as $k => $v){
  1939. // if(!array_key_exists('response',$v)){
  1940. // unset($family_planning[$k]);
  1941. // }
  1942. // }
  1943. // }
  1944. // $data['family_planning'] = json_encode($family_planning);
  1945. //综治
  1946. $manage = $request->input('manage');
  1947. if(is_array($manage)){
  1948. //删除掉没有成功返回路径的图片
  1949. foreach ($manage as $k => $v){
  1950. if(!array_key_exists('response',$v)){
  1951. unset($manage[$k]);
  1952. }
  1953. }
  1954. }
  1955. $data['manage'] = json_encode($manage);
  1956. $data['status'] = 0;
  1957. $data['type'] = 'supplement';
  1958. $result = RecruitSupplement::create($data);
  1959. $appoint_info->political_audit = 4;
  1960. $appoint_info->save();
  1961. return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
  1962. }
  1963. return ['status' => 0, 'msg' => 'test', 'data' => ''];
  1964. }
  1965. public function save_healthinfo(Request $request)
  1966. {
  1967. $user = $this->getUser();
  1968. if (!empty($user)) {
  1969. $uid = $user->id;
  1970. } else {
  1971. return redirect(route('login'));
  1972. }
  1973. $appoint_id = $request->input('appoint_id');
  1974. $type = $request->input('type');
  1975. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('id',$appoint_id)->first();
  1976. if(!$appoint_info){
  1977. return ['status' => 0, 'msg' => '抱歉,找不到您要登记的报名记录!'];
  1978. }
  1979. $recruit = Recruit::where('id',$appoint_info->recruit_id)->first();
  1980. $info = RecruitSupplement::where('appoint_id',$appoint_id)->where('type',$type)->first();
  1981. if($info){
  1982. if($info->h_status == 1){
  1983. return ['status' => 0, 'msg' => '材料已审核通过,不允许修改'];
  1984. }
  1985. if($info->h_status == 0){
  1986. return ['status' => 0, 'msg' => '材料审核中,不允许修改'];
  1987. }
  1988. $health_code = $request->input('health_code');
  1989. if(is_array($health_code)){
  1990. //删除掉没有成功返回路径的图片
  1991. foreach ($health_code as $k => $v){
  1992. if(!array_key_exists('response',$v)){
  1993. unset($health_code[$k]);
  1994. }
  1995. }
  1996. }
  1997. $info->health_code = json_encode($health_code);
  1998. $trip_code = $request->input('trip_code');
  1999. if(is_array($trip_code)){
  2000. //删除掉没有成功返回路径的图片
  2001. foreach ($trip_code as $k => $v){
  2002. if(!array_key_exists('response',$v)){
  2003. unset($trip_code[$k]);
  2004. }
  2005. }
  2006. }
  2007. $info->trip_code = json_encode($trip_code);
  2008. $info->h_status = 0;
  2009. $appoint_info->health_audit = 4;
  2010. $appoint_info->save();
  2011. $info->save();
  2012. return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
  2013. }else{
  2014. $data['appoint_id'] = $appoint_id;
  2015. $data['type'] = $type;
  2016. $data['h_status'] = 0;
  2017. $appoint_info->health_audit = 4;
  2018. $health_code = $request->input('health_code');
  2019. if(is_array($health_code)){
  2020. //删除掉没有成功返回路径的图片
  2021. foreach ($health_code as $k => $v){
  2022. if(!array_key_exists('response',$v)){
  2023. unset($health_code[$k]);
  2024. }
  2025. }
  2026. }
  2027. $health_result = $this->baiduService->health_code(file_get_contents(base_path() . "/public" . $health_code[0]['response']['path']));
  2028. $health_msg = ['健康码自动审核通过'];
  2029. //$h_status = 1;
  2030. //$appoint_info->health_audit = 1;
  2031. if(!array_key_exists('error_msg',$health_result) && !array_key_exists('error_code',$health_result)){
  2032. if(array_key_exists('姓名',$health_result)){
  2033. if(stripos($health_result['姓名'][0]['word'],'*')>0){
  2034. return ['status' => 0, 'msg' => '请打开健康码的“眼睛开关”,显示完整个人信息'];
  2035. }
  2036. if($health_result['姓名'][0]['word'] != $appoint_info->realname){
  2037. array_push($health_msg,'抱歉,请上传您本人的健康码!');
  2038. }
  2039. }else{
  2040. array_push($health_msg,'健康码错误,识别不到姓名!');
  2041. }
  2042. if(array_key_exists('状态',$health_result)){
  2043. if($health_result['状态'][0]['word'] != '绿码'){
  2044. array_push($health_msg,'抱歉,您的健康码非绿码!');
  2045. }
  2046. }else{
  2047. array_push($health_msg,'健康码错误,识别不到状态!');
  2048. }
  2049. if(array_key_exists('更新时间',$health_result)){
  2050. $time = strtotime($health_result['更新时间'][0]['word']);
  2051. if($time < strtotime($recruit->pen_health_start) || $time > strtotime($recruit->pen_health_end)){
  2052. array_push($health_msg,'抱歉,请上传{$recruit->pen_health_start}至{$recruit->pen_health_end}之间的健康码!');
  2053. }
  2054. }else{
  2055. array_push($health_msg,'健康码错误,识别不到时间!');
  2056. }
  2057. //$data['h_status'] = $h_status;
  2058. $data['h_msg'] = implode(';',$health_msg);
  2059. //$appoint_info->health_audit = $h_status == 1 ? 1 : 4;
  2060. $data['health_code'] = json_encode($health_code);
  2061. }
  2062. $data['health_result'] = json_encode($health_result);
  2063. $trip_code = $request->input('trip_code');
  2064. if(is_array($trip_code)){
  2065. //删除掉没有成功返回路径的图片
  2066. foreach ($trip_code as $k => $v){
  2067. if(!array_key_exists('response',$v)){
  2068. unset($trip_code[$k]);
  2069. }
  2070. }
  2071. }
  2072. $trip_result = $this->baiduService->trip_code(file_get_contents(base_path() . "/public" . $trip_code[0]['response']['path']));
  2073. $trip_msg = [];
  2074. $trip_status = 0;
  2075. if(!array_key_exists('error_msg',$trip_result) && !array_key_exists('error_code',$trip_result)){
  2076. if(array_key_exists('途经地',$trip_result['result'])){
  2077. $fangyi_area = explode("\r\n",config('aix.fangyi.fangyi_zhaokao.fangyi_zhaokao.risk_area'));
  2078. $result = array_intersect($fangyi_area,$trip_result['result']['途经地'][0]['word']);
  2079. if(count($result) > 0){
  2080. array_push($trip_msg,'抱歉,您的行程中包含系统设置中高风险地区!');
  2081. $trip_status = 0;
  2082. }
  2083. }
  2084. if(array_key_exists('风险性',$trip_result['result']) && $trip_result['result']['风险性']){
  2085. array_push($trip_msg,'抱歉,您的行程可能含有风险!');
  2086. $trip_status = 0;
  2087. }
  2088. if(array_key_exists('更新时间',$trip_result['result'])){
  2089. $time = strtotime($trip_result['result']['更新时间'][0]['word'][0]);
  2090. if($time > strtotime($recruit->pen_health_start) || $recruit < ($recruit->pen_health_end)){
  2091. array_push($trip_msg,'抱歉,请上传{$recruit->pen_health_start}至{$recruit->pen_health_end}之间的行程码!');
  2092. $trip_status = 0;
  2093. }
  2094. }
  2095. $data['h_msg'] .= implode(';',$trip_msg);
  2096. }
  2097. $data['trip_result'] = json_encode($trip_result);
  2098. $data['trip_code'] = json_encode($trip_code);
  2099. $data['h_status'] = 0;
  2100. $appoint_info->health_audit = 4;
  2101. RecruitSupplement::create($data);
  2102. $appoint_info->save();
  2103. return ['status' => 1, 'msg' => '提交成功,请刷新查看审核结果', 'data' => ''];
  2104. }
  2105. return ['status' => 0, 'msg' => 'test', 'data' => ''];
  2106. }
  2107. public function post_select(Request $request)
  2108. {
  2109. $user = $this->getUser();
  2110. if (!empty($user)) {
  2111. $uid = $user->id;
  2112. } else {
  2113. return redirect(route('login'));
  2114. }
  2115. $recruit_id = $request->input('recruit_id');
  2116. //$appoint_id = $request->input('appoint_id');
  2117. $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
  2118. if(!$info){
  2119. return $this->showMessage('抱歉,您无需择岗!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
  2120. }
  2121. //手动设置择岗时间段
  2122. $time = time();
  2123. if($time > 1663300800 || $time < 1663200000){
  2124. return $this->showMessage('抱歉,未到择岗时间!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
  2125. }
  2126. $option_list = [
  2127. [
  2128. 'id' => 6,
  2129. 'name' => '新塘街道'
  2130. ],
  2131. [
  2132. 'id' => 7,
  2133. 'name' => '陈埭镇'
  2134. ],
  2135. [
  2136. 'id' => 8,
  2137. 'name' => '池店镇'
  2138. ],
  2139. [
  2140. 'id' => 9,
  2141. 'name' => '安海镇'
  2142. ],
  2143. [
  2144. 'id' => 10,
  2145. 'name' => '磁灶镇'
  2146. ],
  2147. [
  2148. 'id' => 11,
  2149. 'name' => '内坑镇'
  2150. ],
  2151. [
  2152. 'id' => 13,
  2153. 'name' => '东石镇'
  2154. ],
  2155. [
  2156. 'id' => 14,
  2157. 'name' => '永和镇'
  2158. ],
  2159. [
  2160. 'id' => 15,
  2161. 'name' => '英林镇'
  2162. ],
  2163. [
  2164. 'id' => 16,
  2165. 'name' => '金井镇'
  2166. ],
  2167. [
  2168. 'id' => 17,
  2169. 'name' => '龙湖镇'
  2170. ],
  2171. [
  2172. 'id' => 18,
  2173. 'name' => '深沪镇'
  2174. ],
  2175. [
  2176. 'id' => 19,
  2177. 'name' => '西滨镇'
  2178. ]
  2179. ];
  2180. $select_list = [];
  2181. if($info->result){
  2182. $result = json_decode($info->result,true);
  2183. foreach ($result as $v){
  2184. $item['name'] = $v;
  2185. array_push($select_list,$item);
  2186. }
  2187. }
  2188. // $recruit_id = $request->input('recruit_id');
  2189. // $appoint_id = $request->input('appoint_id');
  2190. // $uid = $request->input('uid');
  2191. // $info = RecruitAppointSelect::where('uid',$uid)->first();
  2192. // if(!$info){
  2193. // $info = new \stdClass();
  2194. // $info->status = 0;
  2195. // $info->recruit_id = 8;
  2196. // $info->appoint_id = rand(0,999999);
  2197. // $info->uid = rand(0,999999);
  2198. // }else{
  2199. // $result = json_decode($info->result,true);
  2200. // foreach ($option_list as $k => $v){
  2201. // if(in_array($v['name'],$result)){
  2202. // $select_list[$k] = $v;
  2203. // unset($option_list[$k]);
  2204. // }
  2205. // }
  2206. // }
  2207. $view_data = ['info' => $info,'options_list' => json_encode($option_list),'select_list' => json_encode($select_list)];
  2208. return view('app.recruit.post_select',$view_data);
  2209. }
  2210. /**
  2211. * 放弃择岗
  2212. */
  2213. public function give_up_post(Request $request)
  2214. {
  2215. //以下为测试环境
  2216. // $recruit_id = $request->input('recruit_id');
  2217. // $appoint_id = $request->input('appoint_id');
  2218. // $uid = $request->input('uid');
  2219. // $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
  2220. // if($info){
  2221. // return ['status' => 0, 'msg' => "测试数据重复,请重新点击生成测试数据!"];
  2222. // }
  2223. // RecruitAppointSelect::create(['recruit_id'=>$recruit_id,'appoint_id'=>$appoint_id,'uid'=>$uid,'status'=>-1]);
  2224. // return ['status' => 1, 'msg' => "放弃择岗成功!"];
  2225. //以下为正式环境再放开
  2226. $user = $this->getUser();
  2227. if (!empty($user)) {
  2228. $uid = $user->id;
  2229. } else {
  2230. return redirect(route('login'));
  2231. }
  2232. $recruit_id = $request->input('recruit_id');
  2233. $appoint_id = $request->input('appoint_id');
  2234. $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
  2235. if($info == null){
  2236. return ['status' => 0, 'msg' => "抱歉,您无需择岗!"];
  2237. }
  2238. if($info->status != 0){
  2239. return ['status' => 0, 'msg' => "抱歉,您不是待择岗状态!"];
  2240. }
  2241. $info->status = -1;
  2242. $info->save();
  2243. return ['status' => 1, 'msg' => "放弃择岗成功!"];
  2244. }
  2245. public function comfirm_post(Request $request)
  2246. {
  2247. $user = $this->getUser();
  2248. if (!empty($user)) {
  2249. $uid = $user->id;
  2250. } else {
  2251. return redirect(route('login'));
  2252. }
  2253. $recruit_id = $request->input('recruit_id');
  2254. $appoint_id = $request->input('appoint_id');
  2255. $time = time();
  2256. if($time > 1663300800 || $time < 1663200000){
  2257. return $this->showMessage('抱歉,未到择岗时间!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
  2258. }
  2259. $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
  2260. if($info->result){
  2261. return ['status' => 0, 'msg' => "择岗数据已提交!"];
  2262. }
  2263. // $data = [
  2264. // 'recruit_id' => $recruit_id,
  2265. // 'appoint_id' => $recruit_id,
  2266. // 'uid' => $uid,
  2267. // 'status' => 1
  2268. // ];
  2269. $result = [];
  2270. $select = $request->input('select');
  2271. if(is_array($select) && count($select) > 0){
  2272. foreach ($select as $v) {
  2273. array_push($result,$v['name']);
  2274. }
  2275. }
  2276. $info->result = json_encode($result);
  2277. $info->status = 1;
  2278. $info->save();
  2279. return ['status' => 1, 'msg' => "提交择岗意愿成功,请耐心等待结果!"];
  2280. }
  2281. public function select_result(Request $request)
  2282. {
  2283. return view('app.recruit.select_result');
  2284. }
  2285. public function get_select_result(Request $request)
  2286. {
  2287. $redis = Cache::getRedis();
  2288. $quota = $redis->get('recruit_quota');
  2289. if(!$quota){
  2290. $quota = [
  2291. [
  2292. 'name' => '新塘街道',
  2293. 'value' => 13
  2294. ],
  2295. [
  2296. 'name' => '陈埭镇',
  2297. 'value' => 88
  2298. ],
  2299. [
  2300. 'name' => '池店镇',
  2301. 'value' => 10
  2302. ],
  2303. [
  2304. 'name' => '安海镇',
  2305. 'value' => 10
  2306. ],
  2307. [
  2308. 'name' => '磁灶镇',
  2309. 'value' => 21
  2310. ],
  2311. [
  2312. 'name' => '内坑镇',
  2313. 'value' => 22
  2314. ],
  2315. [
  2316. 'name' => '东石镇',
  2317. 'value' => 4
  2318. ],
  2319. [
  2320. 'name' => '永和镇',
  2321. 'value' => 27
  2322. ],
  2323. [
  2324. 'name' => '英林镇',
  2325. 'value' => 5
  2326. ],
  2327. [
  2328. 'name' => '金井镇',
  2329. 'value' => 13
  2330. ],
  2331. [
  2332. 'name' => '龙湖镇',
  2333. 'value' => 53
  2334. ],
  2335. [
  2336. 'name' => '深沪镇',
  2337. 'value' => 23
  2338. ],
  2339. [
  2340. 'name' => '西滨镇',
  2341. 'value' => 3
  2342. ]
  2343. ];
  2344. $redis->set('recruit_quota',json_encode($quota));
  2345. }else{
  2346. $quota = json_decode($quota,true);
  2347. }
  2348. $limit = $request->input('limit',1);
  2349. $list = DB::table('recruit_appoint_select as a')->leftJoin('recruit_appoint_info as b','a.appoint_id','=','b.id')->leftJoin('recruit_ticket as c','a.appoint_id','=','c.appoint_id')->whereRaw('a.select_result is null and a.batch=2 and a.status=1')->select(['b.realname','c.ex_number','a.result','a.select_result','a.id'])->orderBy('record','desc')->limit($limit)->get();
  2350. $return_data = [
  2351. 'list' => []
  2352. ];
  2353. $array_column = array_column($quota,'name');
  2354. foreach ($list as $k => $v){
  2355. $person_select_result = json_decode($v->result,true);
  2356. $flag = 0;//是否择岗成功
  2357. foreach ($person_select_result as $val){
  2358. //寻找下标
  2359. $index = array_search($val,$array_column);
  2360. if($quota[$index]['value'] > 0){
  2361. $quota_data = [
  2362. 'index' => $index,
  2363. 'old_value' => $quota[$index]['value']
  2364. ];
  2365. //有名额允许择岗
  2366. DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>$val,'status' => 1]);
  2367. $v->select_result = $val;
  2368. $quota[$index]['value']--;
  2369. $quota_data['new_value'] = $quota[$index]['value'];
  2370. $redis->set('recruit_quota',json_encode($quota));
  2371. $flag = 1;
  2372. break;
  2373. }
  2374. }
  2375. if(!$flag){
  2376. $v->select_result = '未匹配到志愿,本轮择岗不成功!';
  2377. DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>'未匹配到志愿,本轮择岗不成功!','status' => -2]);
  2378. }
  2379. array_push($return_data['list'],$v);
  2380. }
  2381. $return_data['quota'] = $quota_data;
  2382. return ['status' => 1, 'msg' => '择岗排序成功', 'data' => $return_data];
  2383. }
  2384. public function select_init(Request $request)
  2385. {
  2386. $count = DB::table('recruit_appoint_select')->whereRaw('select_result is null and batch = 2')->count();
  2387. $redis = Cache::getRedis();
  2388. $quota = $redis->get('recruit_quota');
  2389. if(!$quota){
  2390. $quota = [
  2391. [
  2392. 'name' => '新塘街道',
  2393. 'value' => 13
  2394. ],
  2395. [
  2396. 'name' => '陈埭镇',
  2397. 'value' => 88
  2398. ],
  2399. [
  2400. 'name' => '池店镇',
  2401. 'value' => 10
  2402. ],
  2403. [
  2404. 'name' => '安海镇',
  2405. 'value' => 10
  2406. ],
  2407. [
  2408. 'name' => '磁灶镇',
  2409. 'value' => 21
  2410. ],
  2411. [
  2412. 'name' => '内坑镇',
  2413. 'value' => 22
  2414. ],
  2415. [
  2416. 'name' => '东石镇',
  2417. 'value' => 4
  2418. ],
  2419. [
  2420. 'name' => '永和镇',
  2421. 'value' => 27
  2422. ],
  2423. [
  2424. 'name' => '英林镇',
  2425. 'value' => 5
  2426. ],
  2427. [
  2428. 'name' => '金井镇',
  2429. 'value' => 13
  2430. ],
  2431. [
  2432. 'name' => '龙湖镇',
  2433. 'value' => 53
  2434. ],
  2435. [
  2436. 'name' => '深沪镇',
  2437. 'value' => 23
  2438. ],
  2439. [
  2440. 'name' => '西滨镇',
  2441. 'value' => 3
  2442. ]
  2443. ];
  2444. $redis->set('recruit_quota',json_encode($quota));
  2445. }
  2446. $list = DB::table('recruit_appoint_select as a')->leftJoin('recruit_appoint_info as b','a.appoint_id','=','b.id')->leftJoin('recruit_ticket as c','a.appoint_id','=','c.appoint_id')->whereRaw('a.select_result is not null and a.batch=2')->select(['b.realname','c.ex_number','a.result','a.select_result','a.id'])->orderBy('record','desc')->get();
  2447. return ['status' => 1, 'msg' => '获取初始化信息成功', 'data' => ['count' => $count, 'quota' => $quota, 'list' => $list]];
  2448. }
  2449. public function interviewer_random(Request $request)
  2450. {
  2451. $model = $request->input('model',1);
  2452. $number1 = $request->input('number1',5);//考官人数
  2453. $number2 = $request->input('number2',1);//替补人数
  2454. $where[] = ['id','>',0];
  2455. switch ($model){
  2456. case '0':
  2457. $list = DB::table('recruit_interviewer')->get()->toArray();
  2458. shuffle($list);
  2459. $result = array_slice($list, 0, $number1+$number2);
  2460. break;
  2461. case '1':
  2462. $list = DB::table('recruit_interviewer')->get()->toArray();
  2463. shuffle($list);
  2464. $count = $number1;
  2465. for ($i = 0; $i < $count; $i++){
  2466. if(!$list[$i]->status){
  2467. $list[] = $list[$i];
  2468. unset($list[$i]);
  2469. $count++;
  2470. }
  2471. }
  2472. $result = array_slice($list, 0, $number1+$number2);
  2473. break;
  2474. case '2':
  2475. $list = DB::table('recruit_interviewer')->where('status',1)->get()->toArray();
  2476. shuffle($list);
  2477. $result = array_slice($list, 0, $number1+$number2);
  2478. break;
  2479. default:
  2480. $list = DB::table('recruit_interviewer')->get()->toArray();
  2481. shuffle($list);
  2482. for ($i = 0; $i < $number1; $i++){
  2483. dd($list[$i]);
  2484. if(!$list[$i]->status){
  2485. $list[] = $list[$i];
  2486. unset($list[$i]);
  2487. }
  2488. }
  2489. $result = array_slice($list, 0, $number1+$number2);
  2490. break;
  2491. }
  2492. $return_data = [
  2493. 'list' => $result,
  2494. 'number1' => $number1,
  2495. 'number2' => $number2
  2496. ];
  2497. return view('app.recruit.interviewer', $return_data);
  2498. }
  2499. public function supplement_info(Request $request)
  2500. {
  2501. $user = $this->getUser();
  2502. if (!empty($user)) {
  2503. $uid = $user->id;
  2504. } else {
  2505. return redirect(route('login'));
  2506. }
  2507. //招考id
  2508. $id = $request->input('id', 0);
  2509. if (!$id) {
  2510. return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
  2511. }
  2512. $recruit = Recruit::find($id);
  2513. if(!$recruit['status']){
  2514. return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  2515. }
  2516. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  2517. if(!$appoint_info){
  2518. return $this->showMessage('抱歉,您没有报名,无需补充信息!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  2519. }
  2520. $supplement_info = DB::table("recruit_supplement_cunwu")->where('uid',$uid)->where('appoint_id',$appoint_info->id)->first();
  2521. if($supplement_info){
  2522. return $this->showMessage('您已登记信息,无需再次登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  2523. }
  2524. $uids = [179049,179051,175896,177011,179015,179134,166830,179056,179110,179140,179040,179154,168701,149108,176405,176637,179182,179115,52845,179240,179036,170227,179286,179145,177121,169161,179282,179318,179173,179385,179287,175723,165156,179217,179085,179174,179441,179459,179448,179461,179476,170189,158658,162111,179504,177503,169950,173378,179571,179576,179548,175865,132228,168809,158464,150061,179594,169655,179311,168348,179131,179654,179664,179683,175855,179100,56968,179610,179146,179731,176717,179435,179669,175794,179487,176307,179806,179758,179555,179822,176249,179769,179815,179685,179856,179840,179828,179844,179376,169398,169530,170181,179799,179123,179652,179936,176102,179261,179957,179888,180033,180039,180050,180028,180064,180078,159819,180085,179987,177195,176790,175722,179933,176170,180122,176929,179872,180151,180123,176834,179547,179879,180196,170277,159623,179892,179904,180227,179952,180232,165930,179195,173624,180244,180277,180325,180321,180265,179871,179908,149297,179898,180407,180239,169158,175716,169910,180288,180452,162757,180309,180474,179266,164225,180465,169899,180098,175481,179306,180458,176454,180451,180507,180531,169591,180456,175467,180589,180587,180590,180601,179679,180597,180602,180604,175637,179830,165858,179835,180677,169304,180711,180234,180426,169691,176956,178303,170289,177028,179894,180311,176683,169720,150103,180705,176548,176655,180849,176101,180855,180808,180869,180348,180733,180889,180866,180399,180657,180920,180876,179701,152053,180208,175641,180831,169075,180980,180988,180991,180686,181016,181023,180974,152179,179284,181058,168483,177233,176619,181110,180809,180979,181122,180916,181142,180992,177427,181143,169886,147697,181173,181218,181041,181171,163107,180363,151296,169429,150164,181258,176891,56330,169740,181272,170078,177000,181317,180845,181303,180839,180983];//写死用户
  2525. if(!in_array($uid,$uids)){
  2526. return $this->showMessage('您无需登记信息!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  2527. }
  2528. // $limit_time = 1661961599;
  2529. // $time = time();
  2530. // if( $time > $limit_time){
  2531. // return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
  2532. // }
  2533. $view_data = [];
  2534. //$view_data['info'] = json_encode($info);
  2535. $view_data['title'] = $recruit->company;
  2536. $view_data['id'] = $id;
  2537. return view('app.recruit.supplement_info',$view_data);
  2538. }
  2539. public function save_supplement_info(Request $request){
  2540. $user = $this->getUser();
  2541. if (!empty($user)) {
  2542. $uid = $user->id;
  2543. } else {
  2544. return redirect(route('login'));
  2545. }
  2546. //招考id
  2547. $id = $request->input('recruit_id', 0);
  2548. if (!$id) {
  2549. return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
  2550. }
  2551. $recruit = Recruit::find($id);
  2552. if(!$recruit['status']){
  2553. return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
  2554. }
  2555. $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
  2556. if(!$appoint_info){
  2557. return ['status' => 0, 'msg' => '抱歉,您没有报名,无需补充信息!', 'data' => ''];
  2558. }
  2559. if($request->input('marriage') == '已婚'){
  2560. if($request->input('spouse_card_type') == '' || $request->input('spouse_card') == '' || $request->input('spouse_realname') == '' || $request->input('spouse_mobile') == ''){
  2561. return ['status' => 0, 'msg' => '请完善配偶信息!', 'data' => ''];
  2562. }
  2563. }
  2564. $data = [
  2565. 'uid' => $uid,
  2566. 'appoint_id' => $appoint_info->id,
  2567. 'street' => $request->input('street'),
  2568. 'realname' => $request->input('realname'),
  2569. 'sex' => $request->input('sex'),
  2570. 'house' => $request->input('house'),
  2571. 'nation' => $request->input('nation'),
  2572. 'native' => $request->input('native'),
  2573. 'marriage' => $request->input('marriage'),
  2574. 'spouse_card_type' => $request->input('spouse_card_type'),
  2575. 'spouse_card' => $request->input('spouse_card'),
  2576. 'spouse_realname' => $request->input('spouse_realname'),
  2577. 'spouse_mobile' => $request->input('spouse_mobile'),
  2578. 'political' => $request->input('political'),
  2579. 'bank_card' => $request->input('bank_card'),
  2580. 'bank_open' => $request->input('bank_open'),
  2581. 'card' => $request->input('card'),
  2582. 'card_endtime' => $request->input('card_endtime'),
  2583. 'mobile' => $request->input('mobile'),
  2584. 'edu' => $request->input('education'),
  2585. 'pro' => $request->input('pro'),
  2586. 'address' => $request->input('address'),
  2587. 'funds' => $request->input('funds')
  2588. ];
  2589. DB::table('recruit_supplement_cunwu')->insert($data);
  2590. return ['status' => 1, 'msg' => '提交成功!', 'data' => ''];
  2591. }
  2592. public function comfirm_pen(Request $request){
  2593. $user = $this->getUser();
  2594. if (!empty($user)) {
  2595. $uid = $user->id;
  2596. } else {
  2597. return redirect(route('login'));
  2598. }
  2599. //招考id
  2600. $id = $request->input('recruit_id', 0);
  2601. if (!$id) {
  2602. return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
  2603. }
  2604. $recruit = Recruit::find($id);
  2605. if(!$recruit['status']){
  2606. return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
  2607. }
  2608. if(!$recruit->pen_comfirm){
  2609. return ['status' => 0, 'msg' => '该项目无须确认笔试考试!', 'data' => ''];
  2610. }
  2611. $appoint_info = RecruitAppointInfo::where('recruit_id',$id)->where('uid',$uid)->first();
  2612. if(!$appoint_info){
  2613. return ['status' => 0, 'msg' => '找不到您的报名记录,请检查!', 'data' => ''];
  2614. }
  2615. if($appoint_info->audit != 3){
  2616. return ['status' => 0, 'msg' => '您的报名未审核通过,无需确认!', 'data' => ''];
  2617. }
  2618. $time = time();
  2619. if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
  2620. return ['status' => 0, 'msg' => '未在笔试确认时间段!', 'data' => ''];
  2621. }
  2622. if($appoint_info->pen_audit != -2){
  2623. return ['status' => 0, 'msg' => '您已确认参加笔试,无需再次确认!', 'data' => ''];
  2624. }
  2625. $appoint_info->update(['pen_audit' => -1]);
  2626. $log = [
  2627. 'type' => 3,
  2628. 'appoint_id'=> $appoint_info->id,
  2629. 'uid' => $uid,
  2630. 'log' => '用户确认参加笔试'
  2631. ];
  2632. RecruitAppointLog::create($log);
  2633. return ['status' => 1, 'msg' => '确认成功', 'data' => $appoint_info->id];
  2634. }
  2635. public function supplementary_entry(Request $request){
  2636. $user = $this->getUser();
  2637. if (!empty($user)) {
  2638. $uid = $user->id;
  2639. } else {
  2640. return redirect(route('login'));
  2641. }
  2642. //招考id
  2643. $id = $request->input('recruit_id', 0);
  2644. if (!$id) {
  2645. return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
  2646. }
  2647. $recruit = Recruit::find($id);
  2648. if(!$recruit['status']){
  2649. return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
  2650. }
  2651. $appoint_info = RecruitAppointInfo::where('recruit_id',$id)->where('uid',$uid)->first();
  2652. if(!$appoint_info){
  2653. return ['status' => 0, 'msg' => '找不到您的报名记录,请检查!', 'data' => ''];
  2654. }
  2655. $time = time();
  2656. if($time > 1680969600){
  2657. return ['status' => 0, 'msg' => '已停止补充报名!', 'data' => ''];
  2658. }
  2659. if($appoint_info->adjust_limit){
  2660. $appoint_info->update(['adjust' => 1]);
  2661. return ['status' => 1, 'msg' => '补充报名成功!', 'data' => ''];
  2662. }else{
  2663. return ['status' => 0, 'msg' => '您无需补充报名!', 'data' => ''];
  2664. }
  2665. }
  2666. }