| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578 | 
							- <?php
 
- namespace App\Http\Controllers\Web\Recruit;
 
- use App\Http\Controllers\Web\WebBaseController;
 
- use App\Models\RecruitAppointLog;
 
- use App\Models\RecruitTicket;
 
- use App\Validators\RecruitValidatorRequest;
 
- use Illuminate\Http\Request;
 
- use App\Models\Recruit;
 
- use App\Services\Recruit\RecruitService;
 
- use App\Models\RecruitAppointBasic;
 
- use App\Models\RecruitSupplement;
 
- use App\Models\RecruitPost;
 
- use App\Models\RecruitAppointInfo;
 
- use think\Route;
 
- use Illuminate\Support\Facades\Validator;
 
- use Illuminate\Support\Facades\DB;
 
- use App\Models\RecruitAppointExpandSpecial;
 
- use App\Models\RecruitAppointDetail;
 
- use App\Models\RecruitArticle;
 
- use Illuminate\Support\Facades\Cache;
 
- use App\Services\Common\BaiduService;
 
- use App\Models\RecruitAppointSelect;
 
- class IndexController extends WebBaseController
 
- {
 
-     protected $recruitService,$baiduService;
 
-     public function __construct(RecruitService $recruitService,BaiduService $baiduService)
 
-     {
 
-         $this->recruitService = $recruitService;
 
-         $this->baiduService = $baiduService;
 
-     }
 
-     
 
-     public function index(Request $request)
 
-     {
 
-         $key = $request->input('key');
 
-         $list = $this->recruitService->getRecruit($key, 10);
 
-         $return_data = [
 
-             'list' => $list,
 
-             'key'  => $key,
 
-         ];
 
-         return view('app.recruit.index', $return_data);
 
-     }
 
-     
 
-     public function show(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if($user){
 
-             $uid = $user->id;
 
-             $utype = $user->utype;
 
-         }else{
 
-             $uid = 0;
 
-             $utype = 0;
 
-         }
 
-         $id = $request->input('id', 0);
 
-         if (empty($id)) {
 
-             return $this->showMessage('抱歉,请输入指定的招考场次!', route('recruit.list'), true, '上一页', '2');
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if (empty($recruit)) {
 
-             return redirect(route('/recruit/list'));
 
-         }
 
-         $info = Recruit::parse_info($recruit);
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         if(!$info->isApply && $appoint_info){
 
-             $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->orderBy('created_at','asc')->first();
 
-             if($first_post){
 
-                 $info->isApply = 1;
 
-             }
 
-         }
 
-         if($appoint_info){
 
-             
 
-             if($recruit->pen_comfirm){
 
-                 if($appoint_info->audit != 3){
 
-                     $appoint_info->pen_comfirm = 0;
 
-                 }else{
 
-                     $time = time();
 
-                     if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
 
-                         $appoint_info->pen_comfirm = -1; 
 
-                     }else{
 
-                         if($appoint_info->pen_audit != -2){
 
-                             $appoint_info->pen_comfirm = -2;
 
-                         }else{
 
-                             $appoint_info->pen_comfirm = 1;
 
-                         }
 
-                     }
 
-                 }
 
-             }else{
 
-                 $appoint_info->pen_comfirm = 0;
 
-             }
 
-             
 
-             $pen_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',1)->first();
 
-             if($pen_ticket){
 
-                 $pen_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","pen")->where('h_status',1)->first();
 
-                 if(!$pen_health){
 
-                     $appoint_info->pen_ticket = -2;
 
-                 }else{
 
-                     $time = time();
 
-                     if(strtotime($pen_ticket->ex_start) < $time && strtotime($pen_ticket->ex_end) > $time){
 
-                         $appoint_info->pen_ticket = 1;
 
-                     }else{
 
-                         $appoint_info->pen_ticket = -1;
 
-                     }
 
-                 }
 
-             }else{
 
-                 $appoint_info->pen_ticket = 0;
 
-             }
 
-             
 
-             $check_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',2)->first();
 
-             if($check_ticket){
 
-                 $time = time();
 
-                 if(strtotime($check_ticket->ex_start) < $time && strtotime($check_ticket->ex_end) > $time){
 
-                     $appoint_info->check_ticket = 1;
 
-                 }else{
 
-                     $appoint_info->check_ticket = -1;
 
-                 }
 
-             }else{
 
-                 $appoint_info->check_ticket = 0;
 
-             }
 
-             
 
-             $face_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',3)->first();
 
-             if($face_ticket && $appoint_info->face_audit == -1){
 
-                 $face_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","face")->where('h_status',1)->first();
 
-                 if(!$face_health){
 
-                     $appoint_info->face_ticket = -2;
 
-                 }else{
 
-                     $appoint_info->face_ticket = 1;
 
-                 }
 
-             }else{
 
-                 $appoint_info->face_ticket = 0;
 
-             }
 
-             
 
-             $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
 
-             if($reexamine_ticket && $appoint_info->reexamine_audit == -1){
 
-                 $reexamine_health = RecruitSupplement::where("appoint_id",$appoint_info->id)->where("type","reexamine")->where('h_status',1)->first();
 
-                 if(!$reexamine_health){
 
-                     $appoint_info->reexamine_ticket = -2;
 
-                 }else{
 
-                     $appoint_info->reexamine_ticket = 1;
 
-                 }
 
-             }else{
 
-                 $appoint_info->reexamine_ticket = 0;
 
-             }
 
-         }else{
 
-             $appoint_info = new \stdClass();
 
-             $appoint_info->pen_comfirm = 0;
 
-             $appoint_info->pen_audit = 0;
 
-             $appoint_info->post_id = 0;
 
-             $appoint_info->pen_ticket = 0;
 
-             $appoint_info->computer_ticket = 0;
 
-             $appoint_info->face_ticket = 0;
 
-             $appoint_info->check_ticket = 0;
 
-             $appoint_info->reexamine_ticket = 0;
 
-             $appoint_info->realname = '';
 
-             $appoint_info->card = '';
 
-             $appoint_info->mobile = '';
 
-             $appoint_info->sex = 0;
 
-         }
 
-         $notice = $request->input('notice',0);
 
-         if($notice){
 
-             $public_notice_switch = 0;
 
-             $public_notice = RecruitArticle::where('id',$notice)->where('released_at','<',time())->first();
 
-             if (!empty($info)) {
 
-                 $view_data = [
 
-                     'recruit' => $recruit,
 
-                     'info' => $info,
 
-                     'uid' => $uid,
 
-                     'utype' => $utype,
 
-                     'public_notice' => $public_notice,
 
-                     'public_notice_switch' => $public_notice_switch,
 
-                     'appoint_info' => $appoint_info
 
-                 ];
 
-                 return view('app.recruit.show')->with($view_data);
 
-             } else {
 
-                 return back();
 
-             }
 
-         }else{
 
-             $list = RecruitArticle::where('recruit_id',$id)->orderBy('created_at','desc')->where('released_at','<',time())->get();
 
-             $public_notice_switch = 1;
 
-             if (!empty($info)) {
 
-                 $view_data = [
 
-                     'recruit' => $recruit,
 
-                     'info' => $info,
 
-                     'uid' => $uid,
 
-                     'utype' => $utype,
 
-                     'list' => $list,
 
-                     'public_notice_switch' => $public_notice_switch,
 
-                     'appoint_info' => $appoint_info
 
-                 ];
 
-                 return view('app.recruit.show')->with($view_data);
 
-             } else {
 
-                 return back();
 
-             }
 
-         }
 
-     }
 
-     
 
-     public function upload(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if($user){
 
-             $uid = $user->id;
 
-             $utype = $user->utype;
 
-         }else{
 
-             $uid = 0;
 
-             $utype = 0;
 
-         }
 
-         $file = $request->file('file');
 
-         if ($file->isValid()) { 
 
-             
 
-             $ext = $file->getClientOriginalExtension();
 
-             if (!in_array(strtolower($ext), ['jpg', 'jpeg', 'png', 'doc', 'docx', 'pdf'])) {
 
-                 $res['status'] = 0;
 
-                 $res['msg']    = '文件格式不正确';
 
-             } else {
 
-                 
 
-                 $path = $file->getRealPath();
 
-                 $oldname = $file->getClientOriginalName();
 
-                 
 
-                 $filename = 'storage/recruit/' . uniqid() . mt_rand(10000, 99999) . '.' . $ext;
 
-                 
 
-                 Storage::disk('public')->put($filename, file_get_contents($path));
 
-                 $res['status']   = 1;
 
-                 $res['filename'] = $oldname;
 
-                 $res['path']     = "/storage/" . $filename;
 
-                 $res['msg']      = '上传成功';
 
-             }
 
-         } else {
 
-             $res['status'] = 0;
 
-             $res['msg']    = '上传失败';
 
-         }
 
-         return response()->json($res);
 
-     }
 
-     
 
-     public function sign_up_count(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if($user){
 
-             $uid = $user->id;
 
-             $utype = $user->utype;
 
-         }else{
 
-             $uid = 0;
 
-             $utype = 0;
 
-         }
 
-         $id = $request->input('id', 0);
 
-         $refresh = $request->input('refresh', '');
 
-         if (empty($id)) {
 
-             return $this->showMessage('抱歉,请输入指定的招考场次!', route('recruit.list'), true, '上一页', '2');
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if (empty($recruit)) {
 
-             return redirect(route('/recruit/list'));
 
-         }
 
-         if(!$recruit->show_report){
 
-             return $this->showMessage('抱歉,该场次不允许查看报名人数统计结果!', route('recruit.list'), true, '上一页', '2');
 
-         }
 
-         if(Cache::has("sign_up_count_{$recruit->id}") && $refresh != 'jjhc2019') {
 
-             $cache_data = Cache::get("sign_up_count_{$recruit->id}");
 
-             $list = $cache_data['list'];
 
-             $time = $cache_data['time'];
 
-         }else{
 
-             $list = RecruitPost::where('recruit_id',$recruit->id)->where('status',1)->get();
 
-             if(!$list){
 
-                 return $this->showMessage('抱歉,数据暂时未更新或更新出错!', route('recruit.list'), true, '上一页', '2');
 
-             }
 
-             foreach ($list as $k => $v){
 
-                 $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();
 
-                 $list[$k]['checking'] = $res->checking;
 
-                 $list[$k]['fail'] = $res->fail;
 
-                 $list[$k]['success'] = $res->success;
 
-             }
 
-             $time = date('Y-m-d H:i',time());
 
-             $cache_data = [
 
-                 'list' => $list,
 
-                 'time' => $time
 
-             ];
 
-             Cache::put("sign_up_count_{$recruit->id}",$cache_data,60);
 
-         }
 
-         $view_data = [
 
-             'list'  => $list,
 
-             'time' => $time
 
-         ];
 
-         return view('app.recruit.sign_up_count')->with($view_data);
 
-     }
 
-     
 
-     public function sign_up(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('id', 0);
 
-         if (!$id) {
 
-             return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
 
-         }
 
-         
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status'] && !$user->recruit_test){
 
-             return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         if($recruit['current'] != 1){
 
-             return $this->showMessage('抱歉,该项目报名通道已关闭,如有疑问,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         $time = time();
 
-         $formDisabled = 0;
 
-         if(($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)){
 
-             if(!in_array($uid,[161027,59041])){
 
-                 if(!$appoint_info){
 
-                     return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-                 }
 
-                 if($appoint_info){
 
-                     
 
-                     $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->where('appoint_id',$appoint_info->id)->orderBy('created_at','asc')->first();
 
-                     if(!$first_post){
 
-                         return $this->showMessage('抱歉,该项目已过报名时间或尚未开始!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-                     }
 
-                 }
 
-             }
 
-         }
 
-         $view_data['module'] = $forms = explode(',', $recruit['forms']);
 
-         
 
-         if($appoint_info){
 
-             if(in_array('internship',$forms)) {
 
-                 
 
-                 $user_info = $appoint_info;
 
-                 $user_info['sex'] = (string)$user_info['sex'];
 
-                 $user_info['adjust'] = (string)$user_info['adjust'];
 
-                 $user_info['edu_type'] = (string)$user_info['edu_type'];
 
-                 $user_info['family'] = json_decode($user_info['family']);
 
-                 $detail = RecruitAppointDetail::where('recruit_appoint_id',$user_info['id'])->first();
 
-                 if($detail){
 
-                     $user_info['detail'] = $detail->toArray();
 
-                 }else{
 
-                     $user_info['detail'] = [
 
-                         'rewards_and_punishments' => '',
 
-                         'introduce' => ''
 
-                     ];
 
-                 }
 
-                 if(json_decode($user_info['identification'])){
 
-                     $identification = json_decode($user_info['identification'],true);
 
-                     foreach ($identification as $k => $v){
 
-                         if(array_key_exists('response',$v)){
 
-                             $identification[$k]['url'] = $v['response']['path'];
 
-                         }
 
-                     }
 
-                 }else{
 
-                     $identification = [];
 
-                 }
 
-                 $user_info['identification'] = $identification;
 
-                 if(json_decode($user_info['education_certification'])){
 
-                     $education_certification = json_decode($user_info['education_certification'],true);
 
-                     foreach ($education_certification as $k => $v){
 
-                         if(array_key_exists('response',$v)){
 
-                             $education_certification[$k]['url'] = $v['response']['path'];
 
-                         }
 
-                     }
 
-                 }else{
 
-                     $education_certification = [];
 
-                 }
 
-                 $user_info['education_certification'] = $education_certification;
 
-                 if(json_decode($user_info['other_certification'])){
 
-                     $other_certification = json_decode($user_info['other_certification'],true);
 
-                     foreach ($other_certification as $k => $v){
 
-                         if(array_key_exists('response',$v)){
 
-                             $other_certification[$k]['url'] = $v['response']['path'];
 
-                         }
 
-                     }
 
-                 }else{
 
-                     $other_certification = [];
 
-                 }
 
-                 $user_info['other_certification'] = $other_certification;
 
-                 
 
-                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
 
-                 if($logs){
 
-                     $user_info['audit_log'] = $logs->log;
 
-                 }else{
 
-                     $user_info['audit_log'] = '';
 
-                 }
 
-             }else{
 
-                 
 
-                 $user_info = $appoint_info;
 
-                 $user_info['sex'] = (string)$user_info['sex'];
 
-                 $user_info['edu_type'] = (string)$user_info['edu_type'];
 
-                 $user_info['family'] = json_decode($user_info['family']);
 
-                 if(in_array('expand_special',$forms)){
 
-                     $special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$user_info['id'])->first();
 
-                     if($special){
 
-                         $material = json_decode($special['material'],true);
 
-                         if(is_array($material)){
 
-                             foreach ($material as $k => $v){
 
-                                 if(array_key_exists('response',$v)){
 
-                                     if(array_key_exists('path',$v['response'])){
 
-                                         $material[$k]['url'] = $v['response']['path'];
 
-                                     }
 
-                                 }
 
-                             }
 
-                         }
 
-                     }else{
 
-                         $material = [];
 
-                         $special = [
 
-                             'point_apply' => '0',
 
-                             'condition' => ''
 
-                         ];
 
-                     }
 
-                     $user_info['special'] = [
 
-                         'point_apply'   =>  (string)$special['point_apply'],
 
-                         'condition'     =>  $special['condition'],
 
-                         'material'      =>  $material
 
-                     ];
 
-                 }
 
-                 if(in_array('detail',$forms)){
 
-                     $detail = RecruitAppointDetail::where('recruit_appoint_id',$user_info['id'])->first();
 
-                     if($detail){
 
-                         $user_info['detail'] = $detail->toArray();
 
-                     }else{
 
-                         $user_info['detail'] = [
 
-                             'train' =>  '',
 
-                             'rewards_and_punishments' => '',
 
-                             'introduce' => ''
 
-                         ];
 
-                     }
 
-                 }
 
-                 
 
-                 if(in_array('identification',$forms)){
 
-                     if(json_decode($user_info['identification'])){
 
-                         $identification = json_decode($user_info['identification'],true);
 
-                         foreach ($identification as $k => $v){
 
-                             if(array_key_exists('response',$v)){
 
-                                 if(array_key_exists('path',$v['response'])){
 
-                                     $identification[$k]['url'] = $v['response']['path'];
 
-                                 }
 
-                             }
 
-                         }
 
-                     }else{
 
-                         $identification = [];
 
-                     }
 
-                     $user_info['identification'] = $identification;
 
-                 }
 
-                 
 
-                 if(in_array('education_certification',$forms)){
 
-                     if(json_decode($user_info['education_certification'])){
 
-                         $education_certification = json_decode($user_info['education_certification'],true);
 
-                         foreach ($education_certification as $k => $v){
 
-                             if(array_key_exists('response',$v)){
 
-                                 if(array_key_exists('path',$v['response'])){
 
-                                     $education_certification[$k]['url'] = $v['response']['path'];
 
-                                 }
 
-                             }
 
-                         }
 
-                     }else{
 
-                         $education_certification = [];
 
-                     }
 
-                     $user_info['education_certification'] = $education_certification;
 
-                 }
 
-                 
 
-                 if(in_array('other_certification',$forms)){
 
-                     if(json_decode($user_info['other_certification'])){
 
-                         $other_certification = json_decode($user_info['other_certification'],true);
 
-                         foreach ($other_certification as $k => $v){
 
-                             if(array_key_exists('response',$v)){
 
-                                 if(array_key_exists('path',$v['response'])){
 
-                                     $other_certification[$k]['url'] = $v['response']['path'];
 
-                                 }
 
-                             }
 
-                         }
 
-                     }else{
 
-                         $other_certification = [];
 
-                     }
 
-                     $user_info['other_certification'] = $other_certification;
 
-                 }
 
-                 
 
-                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
 
-                 if($logs){
 
-                     $user_info['audit_log'] = $logs->log;
 
-                 }else{
 
-                     $user_info['audit_log'] = '';
 
-                 }
 
-                 
 
-             }
 
-         }
 
-         else{
 
-             
 
-             if(in_array('internship',$forms)){
 
-                 $user_info = json_encode([
 
-                     'recruit_id' => $id,
 
-                     'operation' => 1,
 
-                     'realname' => '',
 
-                     'sex' => '1',
 
-                     'birthday' => '',
 
-                     'card' => '',
 
-                     'nation' => '',
 
-                     'native_place' => '',
 
-                     'political_affiliation' => '',
 
-                     'join_time' => '',
 
-                     'house_register' => '',
 
-                     'education' => '',
 
-                     'school' => '',
 
-                     'pro' => '',
 
-                     'adjust' => '',
 
-                     'mobile' => '',
 
-                     'email' => '',
 
-                     'address' => '',
 
-                     'post_id' => '',
 
-                     'concat_name' => '',
 
-                     'concat_mobile' => '',
 
-                     'resume' => '',
 
-                     'avatar' => '',
 
-                     'family' => [
 
-                         [
 
-                             'relation' => '',
 
-                             'realname' => '',
 
-                             'birthday' => '',
 
-                             'political_affiliation' => '',
 
-                             'work' => ''
 
-                         ]
 
-                     ],
 
-                     'detail' => [
 
-                         'rewards_and_punishments'   =>  '',
 
-                         'introduce'                 =>  ''
 
-                     ],
 
-                     'identification' => [],
 
-                     'education_certification' => [],
 
-                     'other_certification' => []
 
-                 ]);
 
-             }else{
 
-                 
 
-                 $user_info = RecruitAppointBasic::where('uid',$uid)->first();
 
-                 if(!$user_info){
 
-                     
 
-                     return $this->showMessage('请先完善招考基础信息!', route('recruit.recruitInfo',array('recruit_id',$id)), true, '上一页', '3');
 
-                 }
 
-                 $user_info['sex'] = (string)$user_info['sex'];
 
-                 $user_info['edu_type'] = (string)$user_info['edu_type'];
 
-                 $user_info['family'] = json_decode($user_info['family']);
 
-                 if(in_array('expand_special',$forms)){
 
-                     $user_info['special'] = [
 
-                         'point_apply'   =>  '0',
 
-                         'condition'     =>  '',
 
-                         'material'      =>  []
 
-                     ];
 
-                 }
 
-                 if(in_array('detail',$forms)){
 
-                     $user_info['detail'] = [
 
-                         'train'                     =>  '',
 
-                         'rewards_and_punishments'   =>  '',
 
-                         'introduce'                 =>  ''
 
-                     ];
 
-                 }
 
-                 if(in_array('identification',$forms)){
 
-                     $user_info['identification'] = [];
 
-                 }
 
-                 if(in_array('education_certification',$forms)){
 
-                     $user_info['education_certification'] = [];
 
-                 }
 
-                 if(in_array('other_certification',$forms)){
 
-                     $user_info['other_certification'] = [];
 
-                 }
 
-                 $user_info['recruit_id'] = $id;
 
-                 $user_info['operation'] = 1;
 
-             }
 
-         }
 
-         
 
-         $where_post[] = ['recruit_id', '=', $id];
 
-         $where_post[] = ['status', '=', 1];
 
-         $recruit_post = RecruitPost::where($where_post)->get();
 
-         $post = [];
 
-         $post_limit = [];
 
-         foreach ($recruit_post as $value){
 
-             $item = [
 
-                 'value' =>  $value['id'],
 
-                 'label' =>  $value['code'] . " " . $value['name']
 
-             ];
 
-             $post_limit[$value['id']] = json_decode($value['limit']);
 
-             array_push($post,$item);
 
-         }
 
-         $view_data['appoint_info'] = $user_info;
 
-         $view_data['post'] = json_encode($post);
 
-         $view_data['post_limit'] = json_encode($post_limit);
 
-         $view_data['formDisable'] = $formDisabled;
 
-         $view_data['title'] = $recruit->company;
 
-         $view_data['special_condition_type'] = $recruit->special_condition_type;
 
-         $view_data['special_condition_value'] = explode(',',$recruit->special_condition_value);
 
-         return view('app.recruit.sign_up',$view_data);
 
-     }
 
-     public function preview(Request $request)
 
-     {
 
-         $modules = $request->input('modules');
 
-         $view_data['module'] = $forms = explode(',', $modules);
 
-         return view('app.recruit.preview',$view_data);
 
-     }
 
-     
 
-     public function saveSignUp(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $recruit_id = $request->input('recruit_id', 0);
 
-         if (!$recruit_id) {
 
-             return response()->json(['status' => 0,'msg' => '请选择项目!']);
 
-         }
 
-         $recruit = Recruit::find($recruit_id);
 
-         if(!$recruit['status']){
 
-             return response()->json(['status' => 0,'msg' => '抱歉,该项目状态不正确,请联系客服!']);
 
-         }
 
-         if($recruit['current'] != 1){
 
-             return response()->json(['status' => 0,'msg' => '抱歉,该项目报名通道已关闭,如有疑问,请联系客服!']);
 
-         }
 
-         $card = $request->input('card');
 
-         $appointinfo_exist = RecruitAppointInfo::where('card',$card)->where('uid','<>',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if($appointinfo_exist){
 
-             return response()->json(['status' => 0,'msg' => '您的证件已有其他账号的报名记录,请检查!']);
 
-         }
 
-         $time = time();
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if(($time < strtotime($recruit['apply_start']) || strtotime($recruit['apply_end']) < $time)){
 
-             if($appoint_info){
 
-                 
 
-                 $first_post = RecruitAppointLog::where('type',3)->where('uid',$uid)->orderBy('created_at','asc')->first();
 
-                 if(!$first_post){
 
-                     return response()->json(['status' => 0,'msg' => '抱歉,该项目已过报名时间!']);
 
-                 }
 
-             }
 
-             if(!$appoint_info){
 
-                 return response()->json(['status' => 0,'msg' => '抱歉,该项目已过报名时间!']);
 
-             }
 
-         }
 
-         
 
-         $rules = [
 
-             'realname' => 'required',
 
-             'sex' => 'required',
 
-             'birthday' => 'required',
 
-             'avatar' => 'required',
 
-             'nation' => 'required',
 
-             'native_place' => 'required',
 
-             'political_affiliation' => 'required',
 
-             'post_id'   =>  'required',
 
-             'house_register' => 'required',
 
-             
 
-             'education' => 'required',
 
-             'school' => 'required',
 
-             'address' => 'required',
 
-             'mobile' => 'required',
 
-             'email' => 'required',
 
-             'card' => 'required',
 
-             'concat_name' => 'required',
 
-             'concat_mobile' => 'required',
 
-             'resume' => 'required'
 
-         ];
 
-         $messages = [
 
-             'realname.required' => '请填写姓名',
 
-             'sex.required' => '请填写性别',
 
-             'birthday.required' => '请填写出生日期',
 
-             'avatar.required' => '请上传彩色免冠照',
 
-             'nation.required' => '请填写民族',
 
-             'native_place.required' => '请填写籍贯',
 
-             'political_affiliation.required' => '请选择政治面貌',
 
-             'post_id.required' => '请选择报名岗位',
 
-             'house_register.required' => '请填写户籍所在地',
 
-             
 
-             'education.required' => '请输入学历',
 
-             'school.required' => '请输入毕业院校',
 
-             'address.required' => '请填写通信地址',
 
-             'mobile.required' => '请填写手机号码',
 
-             'email.required' => '请填写电子邮箱',
 
-             'card.required' => '请填写身份证号码',
 
-             'resume.required' => '请填写个人简历',
 
-             'concat_name.required' => '请填写联系人姓名',
 
-             'concat_mobile.required' => '请填写联系人手机号码'
 
-         ];
 
-         $create_data = $request->all();
 
-         $validator = Validator::make($create_data,$rules,$messages);
 
-         if ($validator->fails()) {
 
-             $msg = $validator->errors()->all();
 
-             return response()->json(['status' => 0,'msg' => $msg[0]]);
 
-         }else{
 
-             $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');
 
-             
 
-             $year = substr($data['card'],6,4);
 
-             $month = substr($data['card'],10,2);
 
-             $day = substr($data['card'],12,2);
 
-             if($year.'-'.$month.'-'.$day != $data['birthday']){
 
-                 $data['birthday'] = $year.'-'.$month.'-'.$day;
 
-             }
 
-             if(intval(substr($data['card'],16,1)) % 2 == 0){
 
-                 $data['sex'] = 0;
 
-             }else{
 
-                 $data['sex'] = 1;
 
-             }
 
-             $post_info = RecruitPost::where('id',$data['post_id'])->where('recruit_id',$recruit_id)->first();
 
-             if(!$post_info['status'] || $post_info['deleted_at'] != null){
 
-                 return response()->json(['status' => 0,'msg' => '该岗位已失效']);
 
-             }
 
-             
 
-             $operation = $request->input('operation');
 
-             if($operation == 1){
 
-                 $data['audit'] = 0;
 
-             }else{
 
-                 $data['audit'] = 1;
 
-             }
 
-             if(!empty($post_info['limit']) && json_decode($post_info['limit'])){
 
-                 
 
-                 $post_limit = json_decode($post_info['limit'],true);
 
-                 if(is_array($post_limit)){
 
-                     foreach($post_limit as $k => $v){
 
-                         if($k == 'birthday'){
 
-                             $value = str_replace('-','',$data[$k]);
 
-                         }else{
 
-                             $value = $data[$k];
 
-                         }
 
-                         switch ($v['op']){
 
-                             case '=':
 
-                                 if($value != $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case '>':
 
-                                 if($value <= $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case '>=':
 
-                                 if($value < $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case '<':
 
-                                 if($value >= $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case '<=':
 
-                                 if($value > $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case '!=':
 
-                                 if($value == $v['value']){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case 'like':
 
-                                 if(strpos($value,$v['value']) === false){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                             case 'in':
 
-                                 if(strpos($v['value'],$value) === false){
 
-                                     return response()->json(['status' => 0,'msg' => $v['msg']]);
 
-                                 }
 
-                                 break;
 
-                         }
 
-                     }
 
-                 }
 
-             }
 
-             
 
-             
 
-             $familys = $request->input('family');
 
-             $family = [];
 
-             if(is_array($familys)){
 
-                 foreach ($familys as $value){
 
-                     $item = [
 
-                         'relation'  =>  $value['relation'],
 
-                         'realname'  =>  $value['realname'],
 
-                         'birthday'  =>  $value['birthday'],
 
-                         'political_affiliation' =>  $value['political_affiliation'],
 
-                         'work'  =>  $value['work']
 
-                     ];
 
-                     array_push($family,$item);
 
-                 }
 
-             }
 
-             $data['family'] = json_encode($family);
 
-             if($appoint_info){
 
-                 
 
-                 DB::beginTransaction();
 
-                 try{
 
-                     RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->update($data);
 
-                     
 
-                     $forms = explode(',', $recruit['forms']);
 
-                     
 
-                     if(in_array('expand_special',$forms)){
 
-                         $special = $request->input('special');
 
-                         if($special['point_apply']){
 
-                             
 
-                             if(is_array($special['material'])){
 
-                                 foreach ($special['material'] as $k => $v){
 
-                                     if(!array_key_exists('response',$v)){
 
-                                         unset($special['material'][$k]);
 
-                                     }
 
-                                 }
 
-                             }
 
-                             $special['material'] = json_encode($special['material']);
 
-                         }else{
 
-                             $special['condition'] = '';
 
-                             $special['material'] = json_encode([]);
 
-                         }
 
-                         $hasRecord = RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->first();
 
-                         if($hasRecord){
 
-                             RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint_info->id)->update($special);
 
-                         }else{
 
-                             $special['recruit_appoint_id'] = $appoint_info->id;
 
-                             RecruitAppointExpandSpecial::create($special);
 
-                         }
 
-                     }
 
-                     
 
-                     if(in_array('detail',$forms) || in_array('internship',$forms)){
 
-                         $detail = $request->input('detail');
 
-                         $hasRecord = RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->first();
 
-                         if($hasRecord){
 
-                             RecruitAppointDetail::where('recruit_appoint_id',$appoint_info->id)->update($detail);
 
-                         }else{
 
-                             $detail['recruit_appoint_id'] = $appoint_info->id;
 
-                             RecruitAppointDetail::create($detail);
 
-                         }
 
-                     }
 
-                     
 
-                     if(in_array('identification',$forms) || in_array('internship',$forms)){
 
-                         $identification = $request->input('identification');
 
-                         if(is_array($identification)){
 
-                             
 
-                             foreach ($identification as $k => $v){
 
-                                 if(!array_key_exists('response',$v)){
 
-                                     unset($identification[$k]);
 
-                                 }
 
-                             }
 
-                         }
 
-                         $appoint_info->identification = json_encode($identification);
 
-                         $appoint_info->save();
 
-                     }
 
-                     
 
-                     if(in_array('education_certification',$forms) || in_array('internship',$forms)){
 
-                         $education_certification = $request->input('education_certification');
 
-                         if(is_array($education_certification)){
 
-                             
 
-                             foreach ($education_certification as $k => $v){
 
-                                 if(!array_key_exists('response',$v)){
 
-                                     unset($education_certification[$k]);
 
-                                 }
 
-                             }
 
-                         }
 
-                         $appoint_info->education_certification = json_encode($education_certification);
 
-                         $appoint_info->save();
 
-                     }
 
-                     
 
-                     if(in_array('other_certification',$forms) || in_array('internship',$forms)){
 
-                         $other_certification = $request->input('other_certification');
 
-                         if(is_array($other_certification)){
 
-                             
 
-                             foreach ($other_certification as $k => $v){
 
-                                 if(!array_key_exists('response',$v)){
 
-                                     unset($other_certification[$k]);
 
-                                 }
 
-                             }
 
-                         }
 
-                         if($other_certification){
 
-                             $appoint_info->other_certification = json_encode($other_certification);
 
-                             $appoint_info->save();
 
-                         }
 
-                     }
 
-                     DB::commit();
 
-                     if($operation == 2){
 
-                         $log = [
 
-                             'type'      =>  3,
 
-                             'appoint_id'=>  $appoint_info->id,
 
-                             'uid'       =>  $uid,
 
-                             'log'       =>  '用户提交报名'
 
-                         ];
 
-                         RecruitAppointLog::create($log);
 
-                         return ['status' => 1, 'msg' => '提交成功', 'data' => $appoint_info->id];
 
-                     }else{
 
-                         return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $appoint_info->id];
 
-                     }
 
-                 } catch (\Exception $e){
 
-                     DB::rollback();
 
-                     return ['status' => 0, 'msg' => $e->getMessage()];
 
-                 }
 
-             }else{
 
-                 
 
-                 DB::beginTransaction();
 
-                 try{
 
-                     
 
-                     if($index = stripos($data['native_place'],',undefined')){
 
-                         $data['native_place'] = substr($data['native_place'],0,$index);
 
-                     }
 
-                     if($index = stripos($data['house_register'],',undefined')){
 
-                         $data['house_register'] = substr($data['house_register'],0,$index);
 
-                     }
 
-                     $data['uid'] = $uid;
 
-                     $data['recruit_id'] = $recruit_id;
 
-                     $result = RecruitAppointInfo::create($data);
 
-                     
 
-                     $forms = explode(',', $recruit['forms']);
 
-                     
 
-                     if(in_array('expand_special',$forms)){
 
-                         $special = $request->input('special');
 
-                         if($special['point_apply']){
 
-                             if(is_array($special['material'])){
 
-                                 
 
-                                 foreach ($special['material'] as $k => $v){
 
-                                     if(!array_key_exists('response',$v)){
 
-                                         unset($special['material'][$k]);
 
-                                     }
 
-                                 }
 
-                             }
 
-                             $special['material'] = json_encode($special['material']);
 
-                         }
 
-                         $special['recruit_appoint_id'] = $result->id;
 
-                         RecruitAppointExpandSpecial::create($special);
 
-                     }
 
-                     
 
-                     if(in_array('detail',$forms)  || in_array('internship',$forms)){
 
-                         $detail = $request->input('detail');
 
-                         $detail['recruit_appoint_id'] = $result->id;
 
-                         RecruitAppointDetail::create($detail);
 
-                     }
 
-                     
 
-                     if(in_array('identification',$forms)  || in_array('internship',$forms)){
 
-                         $identification = $request->input('identification');
 
-                         if(is_array($identification)){
 
-                             
 
-                             foreach ($identification as $k => $v){
 
-                                 if(!array_key_exists('response',$v)){
 
-                                     unset($identification[$k]);
 
-                                 }
 
-                             }
 
-                         }
 
-                         $result->identification = json_encode($identification);
 
-                         $result->save();
 
-                     }
 
-                     
 
-                     if(in_array('education_certification',$forms)  || in_array('internship',$forms)){
 
-                         $education_certification = $request->input('education_certification');
 
-                         if(is_array($education_certification)){
 
-                             
 
-                             foreach ($education_certification as $k => $v){
 
-                                 if(!array_key_exists('response',$v)){
 
-                                     unset($education_certification[$k]);
 
-                                 }
 
-                             }
 
-                         }
 
-                         $result->education_certification = json_encode($education_certification);
 
-                         $result->save();
 
-                     }
 
-                     
 
-                     if(in_array('other_certification',$forms)  || in_array('internship',$forms)){
 
-                         $other_certification = $request->input('other_certification');
 
-                         if($other_certification){
 
-                             if(is_array($other_certification)){
 
-                                 
 
-                                 foreach ($other_certification as $k => $v){
 
-                                     if(!array_key_exists('response',$v)){
 
-                                         unset($other_certification[$k]);
 
-                                     }
 
-                                 }
 
-                             }
 
-                             $result->other_certification = json_encode($other_certification);
 
-                             $result->save();
 
-                         }
 
-                     }
 
-                     DB::commit();
 
-                     if($operation == 2){
 
-                         $log = [
 
-                             'type'      =>  3,
 
-                             'appoint_id'=>  $result->id,
 
-                             'uid'       =>  $uid,
 
-                             'log'       =>  '用户首次提交报名'
 
-                         ];
 
-                         RecruitAppointLog::create($log);
 
-                         return ['status' => 1, 'msg' => '提交成功', 'data' => $result->id];
 
-                     }else{
 
-                         return ['status' => 1, 'msg' => '资料保存成功,请尽快完善并提交', 'data' => $result->id];
 
-                     }
 
-                 } catch (\Exception $e){
 
-                     DB::rollback();
 
-                     return ['status' => 0, 'msg' => $e->getMessage()];
 
-                 }
 
-             }
 
-         }
 
-     }
 
-     
 
-     public function getUser()
 
-     {
 
-         if (auth('web-member')->check()) {
 
-             $user = auth('web-member')->user();
 
-         } else {
 
-             $user = null;
 
-         }
 
-         return $user;
 
-     }
 
-     
 
-     public function checkUserBasicInfo()
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             $arr = ['status' => 401, 'msg'=>'请登录!'];
 
-             return $arr;
 
-         }
 
-         $info = RecruitAppointBasic::where('uid',$uid)->first();
 
-         if (empty($info)){
 
-             $arr = ['status'=>401,'msg'=>'请先完善招考基本信息','url'=> route('recruit.recruitInfo')];
 
-             return $arr;
 
-         }
 
-         return ['status' => 200, 'msg' => ''];
 
-     }
 
-     
 
-     public function person_recruit()
 
-     {
 
-         $user = auth('web-member')->user();
 
-         $list = RecruitAppointInfo::where('uid',$user->id)
 
-             ->join('recruit', 'recruit.id', '=', 'recruit_appoint_info.recruit_id', 'left')
 
-             ->join('recruit_post', 'recruit_post.id', '=', 'recruit_appoint_info.post_id', 'left')
 
-             ->select('recruit.name as recruit_name','recruit_appoint_info.*','recruit_post.code','recruit_post.name')
 
-             ->get();
 
-         return view('app.person.recruit')->with(['list' => $list,'total' => count($list)]);
 
-     }
 
-     
 
-     public function recruit_info(Request $request)
 
-     {
 
-         $user = auth('web-member')->user();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $info = RecruitAppointBasic::where('uid',$user->id)->first();
 
-         if(!$info){
 
-             $info = [
 
-                 'realname' => '',
 
-                 'sex' => '0',
 
-                 'birthday' => '',
 
-                 'avatar' => '',
 
-                 'nation' => '',
 
-                 'native_place' => '',
 
-                 'political_affiliation' => '',
 
-                 'titles' => '',
 
-                 'work' => '',
 
-                 'house_register' => '',
 
-                 'join_time' => '',
 
-                 'edu_type' => '',
 
-                 'education' => '',
 
-                 'school' => '',
 
-                 'degree' => '',
 
-                 'pro' => '',
 
-                 'address' => '',
 
-                 'card' => '',
 
-                 'mobile' => '',
 
-                 'email' => '',
 
-                 'concat_name' => '',
 
-                 'concat_mobile' => '',
 
-                 'resume' => '',
 
-                 'family' => [
 
-                     [
 
-                         'relation' => '',
 
-                         'realname' => '',
 
-                         'birthday' => '',
 
-                         'political_affiliation' => '',
 
-                         'work' => ''
 
-                     ]
 
-                 ],
 
-                 'is_push' => '1'
 
-             ];
 
-         }else{
 
-             $info->sex = (string)$info->sex;
 
-             $info->edu_type = (string)$info->edu_type;
 
-             $info->is_push = (string)$info->is_push;
 
-             $info->family = empty($info->family) ? [[
 
-                                                         'relation' => '',
 
-                                                         'realname' => '',
 
-                                                         'birthday' => '',
 
-                                                         'political_affiliation' => '',
 
-                                                         'work' => ''
 
-                                                     ]] : json_decode($info->family);
 
-         }
 
-         $recruit_id = $request->input('recruit_id',0);
 
-         return view('app.person.recruit_info',[
 
-             'info'      =>  json_encode($info),
 
-             'recruit_id'=>  $recruit_id
 
-         ]);
 
-     }
 
-     
 
-     public function saveRecruitInfo(RecruitValidatorRequest $request)
 
-     {
 
-         $user = auth('web-member')->user();
 
-         $basic = RecruitAppointBasic::where('uid',$user->id)->first();
 
-         $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');
 
-         if(count($data['family']) > 0){
 
-             $data['family'] = json_encode($data['family']);
 
-         }
 
-         if($basic){
 
-             
 
-             $res = RecruitAppointBasic::where('uid',$user->id)->update($data);
 
-             if (!$res) {
 
-                 return response()->json(['status'=>0,'msg'=>'保存失败,请联系客服']);
 
-             }else{
 
-                 return response()->json(['status'=>1,'msg'=>'个人基础信息保存成功,快去报名吧!']);
 
-             }
 
-         }else{
 
-             
 
-             $data['uid'] = $user->id;
 
-             $res = RecruitAppointBasic::create($data);
 
-             if (!$res) {
 
-                 return response()->json(['status'=>0,'msg'=>'保存失败,请联系客服']);
 
-             }else{
 
-                 return response()->json(['status'=>1,'msg'=>'个人基础信息保存成功,快去报名吧!']);
 
-             }
 
-         }
 
-     }
 
-     
 
-     public function pen_ticket(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if($appoint_info){
 
-             $pen_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',1)->first();
 
-             if($pen_ticket){
 
-                 $health = RecruitSupplement::where('appoint_id',$appoint_info->id)->first();
 
-                 if(!$health || $health->h_status == 0){
 
-                     return $this->showMessage('健康审核信息未通过!', route('home'), true, '上一页', '3');
 
-                 }
 
-                 $time = time();
 
-                 if(strtotime($pen_ticket->ex_start) < $time && strtotime($pen_ticket->ex_end) > $time){
 
-                     RecruitTicket::where('appoint_id',$appoint_info->id)->update(['ex_status' => 1]);
 
-                     $recruit = Recruit::where('id',$recruit_id)->first();
 
-                     $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                     $name = $recruit->name_en;
 
-                     $date = date("Y-m-d",strtotime($recruit->created_at));
 
-                     
 
-                     $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
 
-                     $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/pen/" . $filename . '.pdf';
 
-                     if(file_exists($file)){
 
-                         header('Content-Description: File Transfer');
 
-                         header('Content-Type: application/octet-stream');
 
-                         header('Content-Disposition: attachment; filename='.basename($file));
 
-                         header('Content-Transfer-Encoding: binary');
 
-                         header('Expires: 0');
 
-                         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 
-                         header('Pragma: public');
 
-                         header('Content-Length: ' . filesize($file));
 
-                         ob_clean();   
 
-                         flush();
 
-                         readfile($file);
 
-                     }
 
-                 }else{
 
-                     return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
 
-                 }
 
-             }else{
 
-                 return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-             }
 
-         }else{
 
-             return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-         }
 
-     }
 
-     
 
-     public function check_ticket(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if($appoint_info){
 
-             $check_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',2)->first();
 
-             if($check_ticket){
 
-                 $time = time();
 
-                 if(strtotime($check_ticket->ex_start) < $time && strtotime($check_ticket->ex_end) > $time){
 
-                     RecruitTicket::where('appoint_id',$appoint_info->id)->update(['ex_status' => 1]);
 
-                     $recruit = Recruit::where('id',$recruit_id)->first();
 
-                     $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                     $name = $recruit->name_en;
 
-                     $date = date("Y-m-d",strtotime($recruit->created_at));
 
-                     $filename = date("Y-m-18",time()) . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id];
 
-                     $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/check/" . $filename . '.pdf';
 
-                     if(file_exists($file)){
 
-                         header('Content-Description: File Transfer');
 
-                         header('Content-Type: application/octet-stream');
 
-                         header('Content-Disposition: attachment; filename='.basename($file));
 
-                         header('Content-Transfer-Encoding: binary');
 
-                         header('Expires: 0');
 
-                         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 
-                         header('Pragma: public');
 
-                         header('Content-Length: ' . filesize($file));
 
-                         ob_clean();   
 
-                         flush();
 
-                         readfile($file);
 
-                     }
 
-                 }else{
 
-                     return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
 
-                 }
 
-             }else{
 
-                 return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-             }
 
-         }else{
 
-             return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-         }
 
-     }
 
-     
 
-     public function face_ticket(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if($appoint_info){
 
-             $face_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',3)->first();
 
-             if($face_ticket){
 
-                 $health = RecruitSupplement::where('appoint_id',$appoint_info->id)->first();
 
-                 if(!$health || $health->h_status == 0){
 
-                     return $this->showMessage('健康审核信息未通过!', route('home'), true, '上一页', '3');
 
-                 }
 
-                 $time = time();
 
-                 if(strtotime($face_ticket->ex_start) < $time && strtotime($face_ticket->ex_end) > $time){
 
-                     RecruitTicket::where('id',$face_ticket->id)->update(['ex_status' => 1]);
 
-                     $recruit = Recruit::where('id',$recruit_id)->first();
 
-                     $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                     $name = $recruit->name_en;
 
-                     $date = date("Y-m-d",strtotime($recruit->created_at));
 
-                     
 
-                     $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
 
-                     $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/face/" . $filename . '.pdf';
 
-                     if(file_exists($file)){
 
-                         header('Content-Description: File Transfer');
 
-                         header('Content-Type: application/octet-stream');
 
-                         header('Content-Disposition: attachment; filename='.basename($file));
 
-                         header('Content-Transfer-Encoding: binary');
 
-                         header('Expires: 0');
 
-                         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 
-                         header('Pragma: public');
 
-                         header('Content-Length: ' . filesize($file));
 
-                         ob_clean();   
 
-                         flush();
 
-                         readfile($file);
 
-                     }
 
-                 }else{
 
-                     return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
 
-                 }
 
-             }else{
 
-                 return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-             }
 
-         }else{
 
-             return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-         }
 
-     }
 
-     
 
-     public function reexamine_ticket(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return $this->showMessage('请登录!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if($appoint_info){
 
-             $reexamine_ticket = RecruitTicket::where('appoint_id',$appoint_info->id)->where('ex_type',4)->first();
 
-             if($reexamine_ticket){
 
-                 $time = time();
 
-                 if(strtotime($reexamine_ticket->ex_start) < $time && strtotime($reexamine_ticket->ex_end) > $time){
 
-                     RecruitTicket::where('id',$reexamine_ticket->id)->update(['ex_status' => 1]);
 
-                     $recruit = Recruit::where('id',$recruit_id)->first();
 
-                     $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                     $name = $recruit->name_en;
 
-                     $date = date("Y-m-d",strtotime($recruit->created_at));
 
-                     $filename = sha1($date . '_' . $appoint_info->realname . '_' . $appoint_info->card . '_' . $post_data[$appoint_info->post_id]);
 
-                     $file = base_path() . "/storage/app/public/recruit/ticket/pdf/{$date}/{$name}/reexamine/" . $filename . '.pdf';
 
-                     if(file_exists($file)){
 
-                         header('Content-Description: File Transfer');
 
-                         header('Content-Type: application/octet-stream');
 
-                         header('Content-Disposition: attachment; filename='.basename($file));
 
-                         header('Content-Transfer-Encoding: binary');
 
-                         header('Expires: 0');
 
-                         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 
-                         header('Pragma: public');
 
-                         header('Content-Length: ' . filesize($file));
 
-                         ob_clean();   
 
-                         flush();
 
-                         readfile($file);
 
-                     }
 
-                 }else{
 
-                     return $this->showMessage('非打印时间!', route('home'), true, '上一页', '3');
 
-                 }
 
-             }else{
 
-                 return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-             }
 
-         }else{
 
-             return $this->showMessage('暂无准考证可以打印!', route('home'), true, '上一页', '3');
 
-         }
 
-     }
 
-     
 
-     public function material_supplement(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('id', 0);
 
-         if (!$id) {
 
-             return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status'] && !$user->recruit_test){
 
-             return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         if(!$appoint_info){
 
-             return $this->showMessage('抱歉,您没有报名,无需考察审核!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         if($appoint_info->pen_audit != 1){
 
-             return $this->showMessage('抱歉,您未入闱,无需考察审核!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $limit_time = 1662543000;
 
-         $time = time();
 
-         if( $time > $limit_time){
 
-             return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $info = RecruitSupplement::where('appoint_id',$appoint_info->id)->where('type','supplement')->first();
 
-         if(!$info){
 
-             $info = [
 
-                 'appoint_id' => $appoint_info->id,
 
-                 'identification' => '',
 
-                 'household_register' => '',
 
-                 'education_certification' => '',
 
-                 
 
-                 'manage' => '',
 
-                 'status' => 3
 
-             ];
 
-         }else{
 
-             $info = $info->toArray();
 
-             if(json_decode($info['identification'])){
 
-                 $identification = json_decode($info['identification'],true);
 
-                 foreach ($identification as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $identification[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $identification = [];
 
-             }
 
-             $info['identification'] = $identification;
 
-             if(json_decode($info['household_register'])){
 
-                 $household_register = json_decode($info['household_register'],true);
 
-                 foreach ($household_register as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $household_register[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $household_register = [];
 
-             }
 
-             $info['household_register'] = $household_register;
 
-             if(json_decode($info['education_certification'])){
 
-                 $education_certification = json_decode($info['education_certification'],true);
 
-                 foreach ($education_certification as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $education_certification[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $education_certification = [];
 
-             }
 
-             $info['education_certification'] = $education_certification;
 
-             if(json_decode($info['family_planning'])){
 
-                 $family_planning = json_decode($info['family_planning'],true);
 
-                 foreach ($family_planning as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $family_planning[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $family_planning = [];
 
-             }
 
-             $info['family_planning'] = $family_planning;
 
-             if(json_decode($info['manage'])){
 
-                 $manage = json_decode($info['manage'],true);
 
-                 foreach ($manage as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $manage[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $manage = [];
 
-             }
 
-             $info['manage'] = $manage;
 
-         }
 
-         $view_data['info'] = json_encode($info);
 
-         $view_data['title'] = $recruit->company;
 
-         return view('app.recruit.supplement',$view_data);
 
-     }
 
-     
 
-     public function health_info(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('id', 0);
 
-         if (!$id) {
 
-             return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status'] && !$user->recruit_test){
 
-             return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         if(!$appoint_info){
 
-             return $this->showMessage('抱歉,您没有报名,无需登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         if($appoint_info->audit != 3){
 
-             return $this->showMessage('抱歉,您无需登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $time = time();
 
-         $type = $request->input('type',null);
 
-         $where = [];
 
-         if($type){
 
-             switch ($type){
 
-                 case 'pen':
 
-                     $start = strtotime($recruit->pen_health_start);
 
-                     $end = strtotime($recruit->pen_health_end);
 
-                     break;
 
-                 case 'computer':
 
-                     $start = strtotime($recruit->computer_health_start);
 
-                     $end = strtotime($recruit->computer_health_end);
 
-                     break;
 
-                 case 'face':
 
-                     $start = strtotime($recruit->face_health_start);
 
-                     $end = strtotime($recruit->face_health_end);
 
-                     break;
 
-                 case 'reexamine':
 
-                     $start = strtotime($recruit->reexamine_health_start);
 
-                     $end = strtotime($recruit->reexamine_health_end);
 
-                     break;
 
-                 default:
 
-                     $start = strtotime($recruit->supplement_start);
 
-                     $end = strtotime($recruit->supplement_end);
 
-                     break;
 
-             }
 
-             $where[] = ['type', '=', $type];
 
-         }else{
 
-             $start = strtotime($recruit->supplement_start);
 
-             $end = strtotime($recruit->supplement_end);
 
-         }
 
-         if($time > $end || $time < $start){
 
-             return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $where[] = ['appoint_id', '=', $appoint_info->id];
 
-         $info = RecruitSupplement::where($where)->first();
 
-         if(!$info){
 
-             $info = [
 
-                 'appoint_id' => $appoint_info->id,
 
-                 'health_code' => '',
 
-                 'trip_code' => '',
 
-                 'type' => $type
 
-             ];
 
-         }else{
 
-             $info = $info->toArray();
 
-             if(json_decode($info['health_code'])){
 
-                 $health_code = json_decode($info['health_code'],true);
 
-                 foreach ($health_code as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $health_code[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $health_code = [];
 
-             }
 
-             $info['health_code'] = $health_code;
 
-             if(json_decode($info['trip_code'])){
 
-                 $trip_code = json_decode($info['trip_code'],true);
 
-                 foreach ($trip_code as $k => $v){
 
-                     if(array_key_exists('response',$v)){
 
-                         $trip_code[$k]['url'] = $v['response']['path'];
 
-                     }
 
-                 }
 
-             }else{
 
-                 $trip_code = [];
 
-             }
 
-             $info['trip_code'] = $trip_code;
 
-         }
 
-         $view_data['info'] = json_encode($info);
 
-         $view_data['title'] = $recruit->company;
 
-         return view('app.recruit.health',$view_data);
 
-     }
 
-     public function save_supplement(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $limit_time = 1662543000;
 
-         $time = time();
 
-         if( $time > $limit_time){
 
-             return $this->showMessage('抱歉,考察审核端口已关闭!', route('recruit.show',array('id',18)), true, '上一页', '3');
 
-         }
 
-         $appoint_id = $request->input('appoint_id');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',18)->where('id',$appoint_id)->first();
 
-         if(!$appoint_info){
 
-             return ['status' => 0, 'msg' => '抱歉,找不到您要补登的报名记录!'];
 
-         }
 
-         $info = RecruitSupplement::where('appoint_id',$appoint_id)->where('type','supplement')->first();
 
-         if($info){
 
-             if($info->status == 1){
 
-                 return ['status' => 0, 'msg' => '材料已审核通过,不允许修改'];
 
-             }
 
-             if($info->status == 0){
 
-                 return ['status' => 0, 'msg' => '材料审核中,不允许修改'];
 
-             }
 
-             
 
-             $identification = $request->input('identification');
 
-             if(is_array($identification)){
 
-                 
 
-                 foreach ($identification as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($identification[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->identification = json_encode($identification);
 
-             
 
-             $household_register = $request->input('household_register');
 
-             if(is_array($household_register)){
 
-                 
 
-                 foreach ($household_register as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($household_register[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->household_register = json_encode($household_register);
 
-             
 
-             $education_certification = $request->input('education_certification');
 
-             if(is_array($education_certification)){
 
-                 
 
-                 foreach ($education_certification as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($education_certification[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->education_certification = json_encode($education_certification);
 
-             
 
-             
 
-             $manage = $request->input('manage');
 
-             if(is_array($manage)){
 
-                 
 
-                 foreach ($manage as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($manage[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->manage = json_encode($manage);
 
-             $info->status = 0;
 
-             $info->save();
 
-             $appoint_info->political_audit = 4;
 
-             $appoint_info->save();
 
-             return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
 
-         }else{
 
-             $data['appoint_id'] = $appoint_id;
 
-             
 
-             $identification = $request->input('identification');
 
-             if(is_array($identification)){
 
-                 
 
-                 foreach ($identification as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($identification[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $data['identification'] = json_encode($identification);
 
-             
 
-             $household_register = $request->input('household_register');
 
-             if(is_array($household_register)){
 
-                 
 
-                 foreach ($household_register as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($household_register[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $data['household_register'] = json_encode($household_register);
 
-             
 
-             $education_certification = $request->input('education_certification');
 
-             if(is_array($education_certification)){
 
-                 
 
-                 foreach ($education_certification as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($education_certification[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $data['education_certification'] = json_encode($education_certification);
 
-             
 
-             
 
-             $manage = $request->input('manage');
 
-             if(is_array($manage)){
 
-                 
 
-                 foreach ($manage as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($manage[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $data['manage'] = json_encode($manage);
 
-             $data['status'] = 0;
 
-             $data['type'] = 'supplement';
 
-             $result = RecruitSupplement::create($data);
 
-             $appoint_info->political_audit = 4;
 
-             $appoint_info->save();
 
-             return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
 
-         }
 
-         return ['status' => 0, 'msg' => 'test', 'data' => ''];
 
-     }
 
-     public function save_healthinfo(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $appoint_id = $request->input('appoint_id');
 
-         $type = $request->input('type');
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('id',$appoint_id)->first();
 
-         if(!$appoint_info){
 
-             return ['status' => 0, 'msg' => '抱歉,找不到您要登记的报名记录!'];
 
-         }
 
-         $recruit = Recruit::where('id',$appoint_info->recruit_id)->first();
 
-         $info = RecruitSupplement::where('appoint_id',$appoint_id)->where('type',$type)->first();
 
-         if($info){
 
-             if($info->h_status == 1){
 
-                 return ['status' => 0, 'msg' => '材料已审核通过,不允许修改'];
 
-             }
 
-             if($info->h_status == 0){
 
-                 return ['status' => 0, 'msg' => '材料审核中,不允许修改'];
 
-             }
 
-             $health_code = $request->input('health_code');
 
-             if(is_array($health_code)){
 
-                 
 
-                 foreach ($health_code as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($health_code[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->health_code = json_encode($health_code);
 
-             $trip_code = $request->input('trip_code');
 
-             if(is_array($trip_code)){
 
-                 
 
-                 foreach ($trip_code as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($trip_code[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $info->trip_code = json_encode($trip_code);
 
-             $info->h_status = 0;
 
-             $appoint_info->health_audit = 4;
 
-             $appoint_info->save();
 
-             $info->save();
 
-             return ['status' => 1, 'msg' => '提交成功', 'data' => ''];
 
-         }else{
 
-             $data['appoint_id'] = $appoint_id;
 
-             $data['type'] = $type;
 
-             $data['h_status'] = 0;
 
-             $appoint_info->health_audit = 4;
 
-             $health_code = $request->input('health_code');
 
-             if(is_array($health_code)){
 
-                 
 
-                 foreach ($health_code as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($health_code[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $health_result = $this->baiduService->health_code(file_get_contents(base_path() . "/public" . $health_code[0]['response']['path']));
 
-             $health_msg = ['健康码自动审核通过'];
 
-             
 
-             
 
-             if(!array_key_exists('error_msg',$health_result) && !array_key_exists('error_code',$health_result)){
 
-                 if(array_key_exists('姓名',$health_result)){
 
-                     if(stripos($health_result['姓名'][0]['word'],'*')>0){
 
-                         return ['status' => 0, 'msg' => '请打开健康码的“眼睛开关”,显示完整个人信息'];
 
-                     }
 
-                     if($health_result['姓名'][0]['word'] != $appoint_info->realname){
 
-                         array_push($health_msg,'抱歉,请上传您本人的健康码!');
 
-                     }
 
-                 }else{
 
-                     array_push($health_msg,'健康码错误,识别不到姓名!');
 
-                 }
 
-                 if(array_key_exists('状态',$health_result)){
 
-                     if($health_result['状态'][0]['word'] != '绿码'){
 
-                         array_push($health_msg,'抱歉,您的健康码非绿码!');
 
-                     }
 
-                 }else{
 
-                     array_push($health_msg,'健康码错误,识别不到状态!');
 
-                 }
 
-                 if(array_key_exists('更新时间',$health_result)){
 
-                     $time = strtotime($health_result['更新时间'][0]['word']);
 
-                     if($time < strtotime($recruit->pen_health_start) || $time > strtotime($recruit->pen_health_end)){
 
-                         array_push($health_msg,'抱歉,请上传{$recruit->pen_health_start}至{$recruit->pen_health_end}之间的健康码!');
 
-                     }
 
-                 }else{
 
-                     array_push($health_msg,'健康码错误,识别不到时间!');
 
-                 }
 
-                 
 
-                 $data['h_msg'] = implode(';',$health_msg);
 
-                 
 
-                 $data['health_code'] = json_encode($health_code);
 
-             }
 
-             $data['health_result'] = json_encode($health_result);
 
-             $trip_code = $request->input('trip_code');
 
-             if(is_array($trip_code)){
 
-                 
 
-                 foreach ($trip_code as $k => $v){
 
-                     if(!array_key_exists('response',$v)){
 
-                         unset($trip_code[$k]);
 
-                     }
 
-                 }
 
-             }
 
-             $trip_result = $this->baiduService->trip_code(file_get_contents(base_path() . "/public" . $trip_code[0]['response']['path']));
 
-             $trip_msg = [];
 
-             $trip_status = 0;
 
-             if(!array_key_exists('error_msg',$trip_result) && !array_key_exists('error_code',$trip_result)){
 
-                 if(array_key_exists('途经地',$trip_result['result'])){
 
-                     $fangyi_area = explode("\r\n",config('aix.fangyi.fangyi_zhaokao.fangyi_zhaokao.risk_area'));
 
-                     $result = array_intersect($fangyi_area,$trip_result['result']['途经地'][0]['word']);
 
-                     if(count($result) > 0){
 
-                         array_push($trip_msg,'抱歉,您的行程中包含系统设置中高风险地区!');
 
-                         $trip_status = 0;
 
-                     }
 
-                 }
 
-                 if(array_key_exists('风险性',$trip_result['result']) && $trip_result['result']['风险性']){
 
-                     array_push($trip_msg,'抱歉,您的行程可能含有风险!');
 
-                     $trip_status = 0;
 
-                 }
 
-                 if(array_key_exists('更新时间',$trip_result['result'])){
 
-                     $time = strtotime($trip_result['result']['更新时间'][0]['word'][0]);
 
-                     if($time > strtotime($recruit->pen_health_start) || $recruit < ($recruit->pen_health_end)){
 
-                         array_push($trip_msg,'抱歉,请上传{$recruit->pen_health_start}至{$recruit->pen_health_end}之间的行程码!');
 
-                         $trip_status = 0;
 
-                     }
 
-                 }
 
-                 $data['h_msg'] .= implode(';',$trip_msg);
 
-             }
 
-             $data['trip_result'] = json_encode($trip_result);
 
-             $data['trip_code'] = json_encode($trip_code);
 
-             $data['h_status'] = 0;
 
-             $appoint_info->health_audit = 4;
 
-             RecruitSupplement::create($data);
 
-             $appoint_info->save();
 
-             return ['status' => 1, 'msg' => '提交成功,请刷新查看审核结果', 'data' => ''];
 
-         }
 
-         return ['status' => 0, 'msg' => 'test', 'data' => ''];
 
-     }
 
-     public function post_select(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         
 
-         $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->first();
 
-         if(!$info){
 
-             return $this->showMessage('抱歉,您无需择岗!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
 
-         }
 
-         
 
-         $time = time();
 
-         if($time > 1663300800 || $time < 1663200000){
 
-             return $this->showMessage('抱歉,未到择岗时间!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
 
-         }
 
-         $option_list = [
 
-             [
 
-                 'id' => 6,
 
-                 'name' => '新塘街道'
 
-             ],
 
-             [
 
-                 'id' => 7,
 
-                 'name' => '陈埭镇'
 
-             ],
 
-             [
 
-                 'id' => 8,
 
-                 'name' => '池店镇'
 
-             ],
 
-             [
 
-                 'id' => 9,
 
-                 'name' => '安海镇'
 
-             ],
 
-             [
 
-                 'id' => 10,
 
-                 'name' => '磁灶镇'
 
-             ],
 
-             [
 
-                 'id' => 11,
 
-                 'name' => '内坑镇'
 
-             ],
 
-             [
 
-                 'id' => 13,
 
-                 'name' => '东石镇'
 
-             ],
 
-             [
 
-                 'id' => 14,
 
-                 'name' => '永和镇'
 
-             ],
 
-             [
 
-                 'id' => 15,
 
-                 'name' => '英林镇'
 
-             ],
 
-             [
 
-                 'id' => 16,
 
-                 'name' => '金井镇'
 
-             ],
 
-             [
 
-                 'id' => 17,
 
-                 'name' => '龙湖镇'
 
-             ],
 
-             [
 
-                 'id' => 18,
 
-                 'name' => '深沪镇'
 
-             ],
 
-             [
 
-                 'id' => 19,
 
-                 'name' => '西滨镇'
 
-             ]
 
-         ];
 
-         $select_list = [];
 
-         if($info->result){
 
-             $result = json_decode($info->result,true);
 
-             foreach ($result as $v){
 
-                 $item['name'] = $v;
 
-                 array_push($select_list,$item);
 
-             }
 
-         }
 
-         $view_data = ['info' => $info,'options_list' => json_encode($option_list),'select_list' => json_encode($select_list)];
 
-         return view('app.recruit.post_select',$view_data);
 
-     }
 
-     
 
-     public function give_up_post(Request $request)
 
-     {
 
-         
 
-         
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_id = $request->input('appoint_id');
 
-         $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
 
-         if($info == null){
 
-             return ['status' => 0, 'msg' => "抱歉,您无需择岗!"];
 
-         }
 
-         if($info->status != 0){
 
-             return ['status' => 0, 'msg' => "抱歉,您不是待择岗状态!"];
 
-         }
 
-         $info->status = -1;
 
-         $info->save();
 
-         return ['status' => 1, 'msg' => "放弃择岗成功!"];
 
-     }
 
-     public function comfirm_post(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         $recruit_id = $request->input('recruit_id');
 
-         $appoint_id = $request->input('appoint_id');
 
-         $time = time();
 
-         if($time > 1663300800 || $time < 1663200000){
 
-             return $this->showMessage('抱歉,未到择岗时间!', route('recruit.show',array('id',$recruit_id)), true, '上一页', '2');
 
-         }
 
-         $info = RecruitAppointSelect::where('uid',$uid)->where('recruit_id',$recruit_id)->where('appoint_id',$appoint_id)->first();
 
-         if($info->result){
 
-             return ['status' => 0, 'msg' => "择岗数据已提交!"];
 
-         }
 
-         $result = [];
 
-         $select = $request->input('select');
 
-         if(is_array($select) && count($select) > 0){
 
-             foreach ($select as $v) {
 
-                 array_push($result,$v['name']);
 
-             }
 
-         }
 
-         $info->result = json_encode($result);
 
-         $info->status = 1;
 
-         $info->save();
 
-         return ['status' => 1, 'msg' => "提交择岗意愿成功,请耐心等待结果!"];
 
-     }
 
-     public function select_result(Request $request)
 
-     {
 
-         return view('app.recruit.select_result');
 
-     }
 
-     public function get_select_result(Request $request)
 
-     {
 
-         $redis = Cache::getRedis();
 
-         $quota = $redis->get('recruit_quota');
 
-         if(!$quota){
 
-             $quota = [
 
-                 [
 
-                     'name' => '新塘街道',
 
-                     'value' => 13
 
-                 ],
 
-                 [
 
-                     'name' => '陈埭镇',
 
-                     'value' => 88
 
-                 ],
 
-                 [
 
-                     'name' => '池店镇',
 
-                     'value' => 10
 
-                 ],
 
-                 [
 
-                     'name' => '安海镇',
 
-                     'value' => 10
 
-                 ],
 
-                 [
 
-                     'name' => '磁灶镇',
 
-                     'value' => 21
 
-                 ],
 
-                 [
 
-                     'name' => '内坑镇',
 
-                     'value' => 22
 
-                 ],
 
-                 [
 
-                     'name' => '东石镇',
 
-                     'value' => 4
 
-                 ],
 
-                 [
 
-                     'name' => '永和镇',
 
-                     'value' => 27
 
-                 ],
 
-                 [
 
-                     'name' => '英林镇',
 
-                     'value' => 5
 
-                 ],
 
-                 [
 
-                     'name' => '金井镇',
 
-                     'value' => 13
 
-                 ],
 
-                 [
 
-                     'name' => '龙湖镇',
 
-                     'value' => 53
 
-                 ],
 
-                 [
 
-                     'name' => '深沪镇',
 
-                     'value' => 23
 
-                 ],
 
-                 [
 
-                     'name' => '西滨镇',
 
-                     'value' => 3
 
-                 ]
 
-             ];
 
-             $redis->set('recruit_quota',json_encode($quota));
 
-         }else{
 
-             $quota = json_decode($quota,true);
 
-         }
 
-         $limit = $request->input('limit',1);
 
-         $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();
 
-         $return_data = [
 
-             'list' => []
 
-         ];
 
-         $array_column = array_column($quota,'name');
 
-         foreach ($list as $k => $v){
 
-             $person_select_result = json_decode($v->result,true);
 
-             $flag = 0;
 
-             foreach ($person_select_result as $val){
 
-                 
 
-                 $index = array_search($val,$array_column);
 
-                 if($quota[$index]['value'] > 0){
 
-                     $quota_data = [
 
-                         'index' => $index,
 
-                         'old_value' => $quota[$index]['value']
 
-                     ];
 
-                     
 
-                     DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>$val,'status' => 1]);
 
-                     $v->select_result = $val;
 
-                     $quota[$index]['value']--;
 
-                     $quota_data['new_value'] = $quota[$index]['value'];
 
-                     $redis->set('recruit_quota',json_encode($quota));
 
-                     $flag = 1;
 
-                     break;
 
-                 }
 
-             }
 
-             if(!$flag){
 
-                 $v->select_result = '未匹配到志愿,本轮择岗不成功!';
 
-                 DB::table('recruit_appoint_select')->where('id',$v->id)->update(['select_result'=>'未匹配到志愿,本轮择岗不成功!','status' => -2]);
 
-             }
 
-             array_push($return_data['list'],$v);
 
-         }
 
-         $return_data['quota'] = $quota_data;
 
-         return ['status' => 1, 'msg' => '择岗排序成功', 'data' => $return_data];
 
-     }
 
-     public function select_init(Request $request)
 
-     {
 
-         $count = DB::table('recruit_appoint_select')->whereRaw('select_result is null and batch = 2')->count();
 
-         $redis = Cache::getRedis();
 
-         $quota = $redis->get('recruit_quota');
 
-         if(!$quota){
 
-             $quota = [
 
-                 [
 
-                     'name' => '新塘街道',
 
-                     'value' => 13
 
-                 ],
 
-                 [
 
-                     'name' => '陈埭镇',
 
-                     'value' => 88
 
-                 ],
 
-                 [
 
-                     'name' => '池店镇',
 
-                     'value' => 10
 
-                 ],
 
-                 [
 
-                     'name' => '安海镇',
 
-                     'value' => 10
 
-                 ],
 
-                 [
 
-                     'name' => '磁灶镇',
 
-                     'value' => 21
 
-                 ],
 
-                 [
 
-                     'name' => '内坑镇',
 
-                     'value' => 22
 
-                 ],
 
-                 [
 
-                     'name' => '东石镇',
 
-                     'value' => 4
 
-                 ],
 
-                 [
 
-                     'name' => '永和镇',
 
-                     'value' => 27
 
-                 ],
 
-                 [
 
-                     'name' => '英林镇',
 
-                     'value' => 5
 
-                 ],
 
-                 [
 
-                     'name' => '金井镇',
 
-                     'value' => 13
 
-                 ],
 
-                 [
 
-                     'name' => '龙湖镇',
 
-                     'value' => 53
 
-                 ],
 
-                 [
 
-                     'name' => '深沪镇',
 
-                     'value' => 23
 
-                 ],
 
-                 [
 
-                     'name' => '西滨镇',
 
-                     'value' => 3
 
-                 ]
 
-             ];
 
-             $redis->set('recruit_quota',json_encode($quota));
 
-         }
 
-         $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();
 
-         return ['status' => 1, 'msg' => '获取初始化信息成功', 'data' => ['count' => $count, 'quota' => $quota, 'list' => $list]];
 
-     }
 
-     public function interviewer_random(Request $request)
 
-     {
 
-         $model = $request->input('model',1);
 
-         $number1 = $request->input('number1',5);
 
-         $number2 = $request->input('number2',1);
 
-         $where[] = ['id','>',0];
 
-         switch ($model){
 
-             case '0':
 
-                 $list = DB::table('recruit_interviewer')->get()->toArray();
 
-                 shuffle($list);
 
-                 $result = array_slice($list, 0, $number1+$number2);
 
-                 break;
 
-             case '1':
 
-                 $list = DB::table('recruit_interviewer')->get()->toArray();
 
-                 shuffle($list);
 
-                 $count = $number1;
 
-                 for ($i = 0; $i < $count; $i++){
 
-                     if(!$list[$i]->status){
 
-                         $list[] = $list[$i];
 
-                         unset($list[$i]);
 
-                         $count++;
 
-                     }
 
-                 }
 
-                 $result = array_slice($list, 0, $number1+$number2);
 
-                 break;
 
-             case '2':
 
-                 $list = DB::table('recruit_interviewer')->where('status',1)->get()->toArray();
 
-                 shuffle($list);
 
-                 $result = array_slice($list, 0, $number1+$number2);
 
-                 break;
 
-             default:
 
-                 $list = DB::table('recruit_interviewer')->get()->toArray();
 
-                 shuffle($list);
 
-                 for ($i = 0; $i < $number1; $i++){
 
-                     dd($list[$i]);
 
-                     if(!$list[$i]->status){
 
-                         $list[] = $list[$i];
 
-                         unset($list[$i]);
 
-                     }
 
-                 }
 
-                 $result = array_slice($list, 0, $number1+$number2);
 
-                 break;
 
-         }
 
-         $return_data = [
 
-             'list' => $result,
 
-             'number1'  => $number1,
 
-             'number2' => $number2
 
-         ];
 
-         return view('app.recruit.interviewer', $return_data);
 
-     }
 
-     public function supplement_info(Request $request)
 
-     {
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('id', 0);
 
-         if (!$id) {
 
-             return $this->showMessage('请选择报名项目!', route('home'), true, '上一页', '3');
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status']){
 
-             return $this->showMessage('抱歉,该项目状态不正确,请联系客服!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         if(!$appoint_info){
 
-             return $this->showMessage('抱歉,您没有报名,无需补充信息!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $supplement_info = DB::table("recruit_supplement_cunwu")->where('uid',$uid)->where('appoint_id',$appoint_info->id)->first();
 
-         if($supplement_info){
 
-             return $this->showMessage('您已登记信息,无需再次登记!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $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];
 
-         if(!in_array($uid,$uids)){
 
-             return $this->showMessage('您无需登记信息!', route('recruit.show',array('id',$recruit['id'])), true, '上一页', '3');
 
-         }
 
-         $view_data = [];
 
-         
 
-         $view_data['title'] = $recruit->company;
 
-         $view_data['id'] = $id;
 
-         return view('app.recruit.supplement_info',$view_data);
 
-     }
 
-     public function save_supplement_info(Request $request){
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('recruit_id', 0);
 
-         if (!$id) {
 
-             return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status']){
 
-             return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('uid',$uid)->where('recruit_id',$id)->first();
 
-         if(!$appoint_info){
 
-             return ['status' => 0, 'msg' => '抱歉,您没有报名,无需补充信息!', 'data' => ''];
 
-         }
 
-         if($request->input('marriage') == '已婚'){
 
-             if($request->input('spouse_card_type') == '' || $request->input('spouse_card') == '' || $request->input('spouse_realname') == '' || $request->input('spouse_mobile') == ''){
 
-                 return ['status' => 0, 'msg' => '请完善配偶信息!', 'data' => ''];
 
-             }
 
-         }
 
-         $data = [
 
-             'uid' => $uid,
 
-             'appoint_id' => $appoint_info->id,
 
-             'street' => $request->input('street'),
 
-             'realname' => $request->input('realname'),
 
-             'sex' => $request->input('sex'),
 
-             'house' => $request->input('house'),
 
-             'nation' => $request->input('nation'),
 
-             'native' => $request->input('native'),
 
-             'marriage' => $request->input('marriage'),
 
-             'spouse_card_type' => $request->input('spouse_card_type'),
 
-             'spouse_card' => $request->input('spouse_card'),
 
-             'spouse_realname' => $request->input('spouse_realname'),
 
-             'spouse_mobile' => $request->input('spouse_mobile'),
 
-             'political' => $request->input('political'),
 
-             'bank_card' => $request->input('bank_card'),
 
-             'bank_open' => $request->input('bank_open'),
 
-             'card' => $request->input('card'),
 
-             'card_endtime' => $request->input('card_endtime'),
 
-             'mobile' => $request->input('mobile'),
 
-             'edu' => $request->input('education'),
 
-             'pro' => $request->input('pro'),
 
-             'address' => $request->input('address'),
 
-             'funds' => $request->input('funds')
 
-         ];
 
-         DB::table('recruit_supplement_cunwu')->insert($data);
 
-         return ['status' => 1, 'msg' => '提交成功!', 'data' => ''];
 
-     }
 
-     public function comfirm_pen(Request $request){
 
-         $user = $this->getUser();
 
-         if (!empty($user)) {
 
-             $uid = $user->id;
 
-         } else {
 
-             return redirect(route('login'));
 
-         }
 
-         
 
-         $id = $request->input('recruit_id', 0);
 
-         if (!$id) {
 
-             return ['status' => 0, 'msg' => '请选择报名项目!', 'data' => ''];
 
-         }
 
-         $recruit = Recruit::find($id);
 
-         if(!$recruit['status']){
 
-             return ['status' => 0, 'msg' => '抱歉,该项目状态不正确,请联系客服!', 'data' => ''];
 
-         }
 
-         if(!$recruit->pen_comfirm){
 
-             return ['status' => 0, 'msg' => '该项目无须确认笔试考试!', 'data' => ''];
 
-         }
 
-         $appoint_info = RecruitAppointInfo::where('recruit_id',$id)->where('uid',$uid)->first();
 
-         if(!$appoint_info){
 
-             return ['status' => 0, 'msg' => '找不到您的报名记录,请检查!', 'data' => ''];
 
-         }
 
-         if($appoint_info->audit != 3){
 
-             return ['status' => 0, 'msg' => '您的报名未审核通过,无需确认!', 'data' => ''];
 
-         }
 
-         $time = time();
 
-         if(strtotime($recruit->pen_comfirm_start) > $time || strtotime($recruit->pen_comfirm_end) < $time){
 
-             return ['status' => 0, 'msg' => '未在笔试确认时间段!', 'data' => ''];
 
-         }
 
-         if($appoint_info->pen_audit != -2){
 
-             return ['status' => 0, 'msg' => '您已确认参加笔试,无需再次确认!', 'data' => ''];
 
-         }
 
-         $appoint_info->update(['pen_audit' => -1]);
 
-         $log = [
 
-             'type'      =>  3,
 
-             'appoint_id'=>  $appoint_info->id,
 
-             'uid'       =>  $uid,
 
-             'log'       =>  '用户确认参加笔试'
 
-         ];
 
-         RecruitAppointLog::create($log);
 
-         return ['status' => 1, 'msg' => '确认成功', 'data' => $appoint_info->id];
 
-     }
 
- }
 
 
  |