| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425 | 
							- <?php
 
- namespace App\Admin\Controllers\Recruit;
 
- use App\Http\Controllers\Controller;
 
- use App\Admin\Extensions\Form\ValidateForm;
 
- use App\Models\Member;
 
- use App\Models\Pms;
 
- use App\Models\Recruit;
 
- use App\Models\RecruitAppointDetail;
 
- use App\Models\RecruitAppointExpandSpecial;
 
- use App\Models\RecruitPost;
 
- use App\Models\RecruitAppointInfo;
 
- use App\Models\RecruitSubjoin;
 
- use App\Models\RecruitAppointLog;
 
- use App\Models\RecruitTicketField;
 
- use App\Models\RecruitSupplement;
 
- use dir\Dir;
 
- use Encore\Admin\Grid;
 
- use Encore\Admin\Form;
 
- use Encore\Admin\Show;
 
- use Encore\Admin\Layout\Content;
 
- use Encore\Admin\Facades\Admin;
 
- use Encore\Admin\Auth\Permission;
 
- use Illuminate\Http\Request;
 
- use Illuminate\Support\Facades\DB;
 
- use Illuminate\Support\Facades\Storage;
 
- use App\Models\Admin\AdminUser;
 
- use PhpOffice\PhpWord\TemplateProcessor;
 
- use Chumper\Zipper\Zipper;
 
- use App\Models\RecruitTicket;
 
- use App\Services\Common\SmsService;
 
- use PhpOffice\PhpSpreadsheet\Spreadsheet;
 
- use PhpOffice\PhpSpreadsheet\IOFactory;
 
- use PhpOffice\PhpSpreadsheet\Cell\DataType;
 
- use PhpOffice\PhpWord\IOFactory as WordIOFactory;
 
- use PhpOffice\PhpWord\Settings;
 
- use App\Jobs\TicketJob;
 
- class RecruitController extends Controller
 
- {
 
-     private $smsService;
 
-     public function __construct(SmsService $smsService)
 
-     {
 
-         $this->smsService = $smsService;
 
-     }
 
-     /**
 
-      * 招考报名首页
 
-      * @param Content $content
 
-      * @return Content
 
-      */
 
-     public function index(Content $content)
 
-     {
 
-         return $content
 
-             ->header('招考报名管理')
 
-             ->description('')
 
-             ->body($this->grid());
 
-     }
 
-     /**
 
-      * 新增招考报名表单页.
 
-      *
 
-      * @param Content $content
 
-      * @return Content
 
-      */
 
-     public function create(Content $content)
 
-     {
 
-         Permission::check('recruit_manager_create');
 
-         return $content
 
-             ->header('新增招聘场次')
 
-             ->description('新增')
 
-             ->body(view('admin.recruit.index')->with(['grid' => $this->form()->render(), 'id' => '0']));
 
-     }
 
-     /**
 
-      * Edit interface.
 
-      *
 
-      * @param mixed $id
 
-      * @param Content $content
 
-      * @return Content
 
-      */
 
-     public function edit($id, Content $content)
 
-     {
 
-         Permission::check('recruit_manager_edit');
 
-         $recruit = Recruit::find($id);
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         $grid = $this->form()->edit($id)->render();
 
-         return $content
 
-             ->header('招考管理')
 
-             ->description('编辑')
 
-             ->body(view('admin.recruit.index')->with(['grid' => $grid, 'id' => $id]));
 
-     }
 
-     /**
 
-      * Show interface.
 
-      *
 
-      * @param mixed $id
 
-      * @param Content $content
 
-      * @return Content
 
-      */
 
-     public function show($id, Content $content)
 
-     {
 
-         return redirect('/ST3IXxKlOa4eGEv0eTw0CfORI9444Mgj/recruit/index');
 
-     }
 
-     public function detail($id)
 
-     {
 
-         $show = new Show(Recruit::findOrFail($id));
 
- //        $recruit = Recruit::findOrFail($id);
 
-         $show->title('标题');
 
-         $show->created_at('创建时间');
 
-         return $show;
 
-     }
 
-     /**
 
-      * 获得招考场次的岗位
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      */
 
-     public function getRecruitPost(Request $request)
 
-     {
 
-         Permission::check('recruit_manager_create');
 
-         Permission::check('recruit_manager_edit');
 
-         $id = $request->id;
 
-         $recruit = Recruit::find($id);
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         $post = RecruitPost::where('recruit_id', $id)->get();
 
-         return response()->json(['post' => $post, 'recruit' => $recruit], '200');
 
-     }
 
-     /**
 
-      * Make a grid builder.
 
-      *
 
-      * @return Grid
 
-      */
 
-     protected function grid()
 
-     {
 
-         $grid = new Grid(new Recruit);
 
-         $grid->model()->where('special',0);
 
-         $grid->model()->orderBy('created_at', 'DESC');
 
-         $grid->model()->paginate(20);
 
-         if (Admin::user()->can('recruit_manager_create')) {
 
-             $grid->disableCreateButton(false);
 
-         }
 
-         $grid->perPages([10, 20, 30, 40, 50, 100]);
 
-         $grid->id('ID');
 
-         $grid->name('招考场次名称');
 
-         $grid->column('current','当前阶段')->display(function ($current) {
 
-             switch ($current){
 
-                 case '1':
 
-                     return '报名';
 
-                     break;
 
-                 case '2':
 
-                     return '审核';
 
-                     break;
 
-                 case '3':
 
-                     return '笔试';
 
-                     break;
 
-                 case '4':
 
-                     return '上机测试';
 
-                     break;
 
-                 case '5':
 
-                     return '面试';
 
-                     break;
 
-                 case '6':
 
-                     return '复试';
 
-                     break;
 
-                 case '7':
 
-                     return '体检';
 
-                     break;
 
-                 case '8':
 
-                     return '政审';
 
-                     break;
 
-                 case '9':
 
-                     return '公示';
 
-                     break;
 
-                 case '0':
 
-                     return '已结束';
 
-                     break;
 
-             }
 
-         });
 
-         $grid->column('status','状态')->display(function ($status) {
 
-             return $status ? '显示' : '隐藏';
 
-         });
 
-         $grid->filter(function ($filter) {
 
-             $filter->disableIdFilter();
 
-             $filter->where(function ($query) {
 
-                 $query->where('simple', '=', "{$this->input}");
 
-             }, '类型', 'simple')->radio([0 => '招考',1 => '招聘']);
 
-         });
 
-         $grid->created_at('创建时间');
 
-         $grid->actions(function ($actions) {
 
-             $actions->append('<a href="/ST3IXxKlOa4eGEv0eTw0CfORI9444Mgj/recruit/appoint_list?id=' . $actions->row['id'] . '"  class="btn btn-primary btn-xs" >报名管理</a>');
 
-             $actions->disableEdit(false);
 
-             $actions->disableDelete(false);
 
-             $actions->disableView();
 
-         });
 
-         return $grid;
 
-     }
 
-     /**
 
-      * 新增/修改招考场次的表单
 
-      *
 
-      * @return Form
 
-      */
 
-     protected function form()
 
-     {
 
-         $form = new ValidateForm(new Recruit);
 
-         $form->tab('基础信息', function ($form) {
 
-             $form->text('name', '招考场次名称')->rules('required|between:4,61', [
 
-                 'required' => '请填写招考场次名称',
 
-                 'between' => '招考场次名称长度为2~30个字符'
 
-             ])->setWidth(5)->setMustMark();
 
-             $form->text('company', '招聘主体')->rules('required|between:4,61', [
 
-                 'required' => '请填写招聘主体',
 
-                 'between' => '招聘主体长度为2~30个字符'
 
-             ])->setWidth(5)->setMustMark();
 
-             $form->text('name_en', '英文标识')->setWidth(5)->help('同一个招聘单位,发布的招聘场次若不在同一天,允许一样,若为空则自动生成');
 
-             $form->image('small_img', '缩略图')->uniqueName()->setWidth(3);
 
-             $form->radio('simple', '类型')->options([0 => '招聘', 1 => '招考'])->default(0)->setMustMark();
 
-             $form->switch('status', '状态')->default(1)->setMustMark();
 
-             $form->switch('show_report', '显示报名人数')->default(0)->setMustMark();
 
-             $form->radio('current', '当前进展')->options([1 => '报名', 2 => '审核', 3 => '笔试', 4 => '上机测试', 5 => '面试', 6 => '复试', 7 => '体检', 8 => '政审', 9 => '公示',0 => '已结束'])->default(1)->setMustMark();
 
-             $form->checkbox('step', '招考流程')->options([1 => '报名', 2 => '审核', 3 => '笔试', 4 => '上机测试', 5 => '面试', 6 => '复试', 7 => '体检', 8 => '政审', 9 => '公示'])->default([1, 2])->setMustMark();
 
-             $form->datetimeRange('apply_start', 'apply_end', '报名日期')->rules('required', array('required' => '报名日期必须设置'))->setMustMark();
 
-             $form->datetimeRange('audit_start', 'audit_end', '审核日期');
 
-             $form->datetimeRange('preliminary_start', 'preliminary_end', '笔试时间');
 
-             $form->datetimeRange('computer_start', 'computer_end', '上机时间');
 
-             $form->datetimeRange('interview_start', 'interview_end', '面试时间');
 
-             $form->datetimeRange('reexamine_start', 'reexamine_end', '复试时间');
 
-             $form->datetimeRange('health_start', 'health_end', '体检时间');
 
-             $form->datetimeRange('political_start', 'political_end', '政审时间');
 
-             $form->datetimeRange('publicity_start', 'publicity_end', '公示时间');
 
-             $form->editor('introduction', '招考正文')->rules('required', array('required' => '招考正文不能为空。'))->setMustMark();
 
-             $form->text('contact', '联系人');
 
-             $form->text('phone', '联系电话');
 
-             $form->text('host_address', '联系地址');
 
-             $form->image('qr_code', '联系人二维码');
 
-             $form->editor('chengnuoshu','承诺书');
 
-             //$form->switch('predetermined_status', '是否允许报名')->states($display_option)->default(1)->setMustMark();
 
-             $form->number('ordid', '排序')->default(0);
 
-             $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time());
 
-         })->tab('报名表单与条件', function ($form) {
 
-             $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块','hj_certification' => '户籍证明上传模块', 'remark' => '备注模块','chengnuoshu'=>'诚信承诺书','shixin'=>'失信被执行人查询信息页扫描件','baokaoshengming' => '报考声明书','internship' => '实习专场'])->default(['basic'])->setMustMark();
 
-             $str = "let num = $(\"#forms\").find(\".checked\").length;
 
-             if(num == 0){
 
-                 alert(\"未选中报名表单模块\");
 
-                 return false;
 
-             }
 
-             let modules = new Array();
 
-             $.each($(\"#forms\").find(\".checked\"),function(index,item){
 
-                 modules.push($(item).children(\"input\").val())
 
-             });
 
-             window.open(\"https://www.jucai.gov.cn/recruit/preview?modules=\"+modules.join(','));
 
-             return false;";
 
-             $form->button('test','勾选对应模块后点击我')->on('click',$str);
 
-             $form->text('limit_times', '报名次数限制')->rules('required|regex:/^\d+$/', [
 
-                 'required' => '报名限制次数必须填写',
 
-                 'regex' => '次数必须为数字'
 
-             ])->default(1)->help('同一个场次允许同时报名几个岗位,直接输入数字即可');
 
-             $form->text('post_times', '审核次数限制')->rules('required|regex:/^\d+$/', [
 
-                 'required' => '审核限制次数必须填写',
 
-                 'regex' => '次数必须为数字'
 
-             ])->default(1)->help('允许提交审核的次数,直接输入数字即可');
 
-             $form->datetimeRange('supplement_start', 'supplement_end', '材料补登时间');
 
-             $form->radio('pay_switch', '缴费报名')->options([0 => '否', 1 => '是'])->default(0);
 
-             $form->radio('special_condition_type', '加分条件样式')->options([0 => '手输', 1 => '整场下拉选择',2 => '岗位适配'])->default(0);
 
-             $form->text('special_condition_value', '加分条件值')->default("")->help('如选择手输或岗位适配,此放放空,选择整场下拉请输入JSON限制值');
 
-         })->tab('笔试', function ($form) {
 
-             $form->switch('pen_comfirm', '笔试确认')->help("打开后将会在设置时间段内开启笔试确认功能,有且仅当确认了才能打印准考证参加笔试")->default(0)->setMustMark();
 
-             $form->datetimeRange('pen_comfirm_start', 'pen_comfirm_end', '确认笔试时间')->help("设置该时间后,仅在该时间段内才可以确认参加笔试");
 
-             $form->radio('pen_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1);
 
-             $form->file('pen_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID');
 
-             $form->listbox('pen_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('pen'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染');
 
-             $form->switch('pen_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark();
 
-             $form->switch('pen_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark();
 
-             $form->datetimeRange('pen_health_start', 'pen_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以");
 
-         })->tab('上机', function ($form) {
 
-             $form->radio('computer_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1);
 
-             $form->file('computer_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID');
 
-             $form->listbox('computer_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('computer'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染');
 
-             $form->switch('computer_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark();
 
-             $form->switch('computer_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark();
 
-             $form->datetimeRange('computer_health_start', 'computer_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以");
 
-         })->tab('面试', function ($form) {
 
-             $form->radio('face_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1);
 
-             $form->file('face_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID');
 
-             $form->listbox('face_ticket_field', '模板字段')->options(RecruitTicketField::ticketFieldData('face'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染');
 
-             $form->switch('face_epidemic', '两码上传')->help("下列依赖两码设置,须此项打开才可生效")->default(0)->setMustMark();
 
-             $form->switch('face_health', '健康状态')->help('当两码上传打开且该选项打开时,打印准考证必须通过两码审核')->default(0)->setMustMark();
 
-             $form->datetimeRange('face_health_start', 'face_health_end', '两码时间')->help("设置该时间后,仅在该时间段内上传该时段内的两码截图才可以");
 
-         })->tab('复试', function ($form) {
 
-             $form->radio('reexamine_ticket_type', '准考证类型')->options([-1 => '不需要',1 => '纸质', 2 => '短信', 3 => '模板'])->default(-1);
 
-             $form->file('reexamine_ticket_content', '准考证内容')->help('当类型为纸质时,此处填入准考证模板的路径,当类型为短信时,此处填入短信标识,当类型为模板时,输入模板ID');
 
-             $form->listbox('reexamine_field', '模板字段')->options(RecruitTicketField::ticketFieldData('reexamine'))->attribute('hight', '200px')->help('仅纸质准考证需要,非ex开头的字段将自动渲染');
 
-         });
 
-         return $form;
 
-     }
 
-     /**
 
-      * Make a form builder.
 
-      *
 
-      * @return Form
 
-      */
 
-     public function store(Request $request)
 
-     {
 
-         $verify = $this->form()->getValidateInput();//这个方法会调用Form自带的验证和表单处理(文件上传等)验证错误会直接返回错误.不需要判断;
 
-         $postCode = $request->input('postcode', []);
 
-         $postName = $request->input('postname', []);
 
-         if (count($postCode) == 0 or (count($postCode) >= 1 and $postCode[0] == null)) {
 
-             return admin_toastr('请填写招考岗位', 'error');
 
-         }
 
-         if (count($postName) == 0 or (count($postName) >= 1 and $postName[0] == null)) {
 
-             return admin_toastr('请填写招考岗位名称', 'error');
 
-         }
 
-         $data = [];
 
-         $data['name'] = $verify['name'];
 
-         $data['company'] = $verify['company'];
 
-         $data['name_en'] = (array_key_exists('name_en',$verify) && !empty($verify['name_en'])) ? $verify['name_en'] : uniqid();
 
-         if(array_key_exists('small_img',$verify)){
 
-             $data['small_img'] = $verify['small_img'];
 
-         }else{
 
-             $data['small_img'] = theme_asset('app/images/index/recruit_index.jpg');
 
-         }
 
-         $data['status'] = $verify['status'];
 
-         $data['show_report'] = $verify['show_report'];
 
-         $data['current'] = $verify['current'];
 
-         $data['step'] = implode(',',array_filter($verify['step']));
 
-         $data['apply_start'] = $verify['apply_start'] ? $verify['apply_start'] : null;//报名时间
 
-         $data['apply_end'] = $verify['apply_end'] ? $verify['apply_end'] : null;
 
-         if($verify['audit_start']){//审核时间
 
-             $data['audit_start'] = $verify['audit_start'];
 
-         }
 
-         if($verify['audit_end']){//审核时间
 
-             $data['audit_end'] = $verify['audit_end'];
 
-         }
 
-         if($verify['preliminary_start']){//笔试时间
 
-             $data['preliminary_start'] = $verify['preliminary_start'];
 
-         }
 
-         if($verify['preliminary_end']){//笔试时间
 
-             $data['preliminary_end'] = $verify['preliminary_end'];
 
-         }
 
-         if($verify['computer_start']){//上机时间
 
-             $data['computer_start'] = $verify['computer_start'];
 
-         }
 
-         if($verify['computer_end']){//上机时间
 
-             $data['computer_end'] = $verify['computer_end'];
 
-         }
 
-         if($verify['interview_start']){//面试时间
 
-             $data['interview_start'] = $verify['interview_start'];
 
-         }
 
-         if($verify['interview_end']){//面试时间
 
-             $data['interview_end'] = $verify['interview_end'];
 
-         }
 
-         if($verify['reexamine_start']){//复试时间
 
-             $data['reexamine_start'] = $verify['reexamine_start'];
 
-         }
 
-         if($verify['reexamine_end']){//复试时间
 
-             $data['reexamine_end'] = $verify['reexamine_end'];
 
-         }
 
-         if($verify['health_start']){//体检时间
 
-             $data['health_start'] = $verify['health_start'];
 
-         }
 
-         if($verify['health_end']){//体检时间
 
-             $data['health_end'] = $verify['health_end'];
 
-         }
 
-         if($verify['political_start']){//政审时间
 
-             $data['political_start'] = $verify['political_start'];
 
-         }
 
-         if($verify['political_end']){//政审时间
 
-             $data['political_end'] = $verify['political_end'];
 
-         }
 
-         if($verify['publicity_start']){//公示时间
 
-             $data['publicity_start'] = $verify['publicity_start'];
 
-         }
 
-         if($verify['publicity_end']){//公示时间
 
-             $data['publicity_end'] = $verify['publicity_end'];
 
-         }
 
-         if($verify['supplement_start']){//材料补充时间
 
-             $data['supplement_start'] = $verify['supplement_start'];
 
-         }
 
-         if($verify['supplement_end']){//材料补充时间
 
-             $data['supplement_end'] = $verify['supplement_end'];
 
-         }
 
-         $data['introduction'] = $verify['introduction'];
 
-         if($verify['host_address']){
 
-             $data['host_address'] = $verify['host_address'];
 
-         }
 
-         if($verify['contact']){
 
-             $data['contact'] = $verify['contact'];
 
-         }
 
-         if($verify['phone']){
 
-             $data['phone'] = $verify['phone'];
 
-         }
 
-         if(array_key_exists('qr_code',$verify)){
 
-             $data['qr_code'] = $verify['qr_code'];
 
-         }
 
-         if(array_key_exists('chengnuoshu',$verify)){
 
-             $data['chengnuoshu'] = $verify['chengnuoshu'];
 
-         }
 
-         if(array_key_exists('addFile',$verify)){
 
-             $data['addFile'] = $verify['addFile'];
 
-         }
 
-         $data['ordid'] = $verify['ordid'];
 
-         $data['limit_times'] = $verify['limit_times'];
 
-         $data['post_times'] = $verify['post_times'];
 
-         $data['pay_switch'] = $verify['pay_switch'];
 
-         $data['special_condition_type'] = $verify['special_condition_type'];
 
-         if($verify['special_condition_value']){
 
-             $data['special_condition_value'] = $verify['special_condition_value'];
 
-         }
 
-         $data['forms'] = implode(',',array_filter($verify['forms']));
 
-         $data['pen_ticket_type'] = $verify['pen_ticket_type'];
 
-         if(array_key_exists('pen_ticket_content',$verify) && !empty($verify['pen_ticket_content'])){
 
-             $data['pen_ticket_content'] = $verify['pen_ticket_content'];
 
-         }
 
-         //$data['pen_ticket_status'] = 0;
 
-         if($verify['pen_ticket_field']){
 
-             $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
 
-         }
 
-         $data['pen_comfirm'] = $verify['pen_comfirm'];
 
-         if($verify['pen_comfirm_start']){
 
-             $data['pen_comfirm_start'] = $verify['pen_comfirm_start'];
 
-         }
 
-         if($verify['pen_comfirm_end']){
 
-             $data['pen_comfirm_end'] = $verify['pen_comfirm_end'];
 
-         }
 
-         $data['pen_epidemic'] = $verify['pen_epidemic'];
 
-         $data['pen_health'] = $verify['pen_health'];
 
-         if($verify['pen_health_start']){
 
-             $data['pen_health_start'] = $verify['pen_health_start'];
 
-         }
 
-         if($verify['pen_health_end']){
 
-             $data['pen_health_end'] = $verify['pen_health_end'];
 
-         }
 
-         $data['computer_ticket_type'] = $verify['computer_ticket_type'];
 
-         if(array_key_exists('computer_ticket_content',$verify) && !empty($verify['computer_ticket_content'])){
 
-             $data['computer_ticket_content'] = $verify['computer_ticket_content'];
 
-         }
 
-         //$data['computer_ticket_status'] = 0;
 
-         if($verify['computer_ticket_field']){
 
-             $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
 
-         }
 
-         $data['face_ticket_type'] = $verify['face_ticket_type'];
 
-         if(array_key_exists('face_ticket_content',$verify) && !empty($verify['face_ticket_content'])){
 
-             $data['face_ticket_content'] = $verify['face_ticket_content'];
 
-         }
 
-         //$data['face_ticket_status'] = 0;
 
-         if($verify['face_ticket_field']){
 
-             $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
 
-         }
 
-         $data['face_epidemic'] = $verify['face_epidemic'];
 
-         $data['face_health'] = $verify['face_health'];
 
-         if($verify['face_health_start']){
 
-             $data['face_health_start'] = $verify['face_health_start'];
 
-         }
 
-         if($verify['face_health_end']){
 
-             $data['face_health_end'] = $verify['face_health_end'];
 
-         }
 
-         $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type'];
 
-         if(array_key_exists('reexamine_ticket_content',$verify) && !empty($verify['reexamine_ticket_content'])){
 
-             $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
 
-         }
 
-         //$data['reexamine_ticket_status'] = 0;
 
-         if($verify['reexamine_field']){
 
-             $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
 
-         }
 
-         $data['special'] = 0;
 
-         $fileCharater = $request->input('addFile');
 
-         DB::beginTransaction();//检查数据库事务
 
-         try {
 
-             $recruit = Recruit::create($data);
 
-             $recruit_id = $recruit->id;
 
-             //添加招聘岗位
 
-             $postcode_array = $request->postcode;
 
-             $postname_array = $request->postname;
 
-             $postnumber_array = $request->postnumber;
 
-             $limit_array = $request->postlimit;
 
-             $special_array = $request->postspecial;
 
-             $countnum = count($postcode_array);
 
-             for ($i = 0; $i < $countnum; $i++) {
 
-                 $data = array();
 
-                 if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') {
 
-                     $data['code'] = $postcode_array[$i];
 
-                     $data['name'] = $postname_array[$i];
 
-                     $data['number'] = $postnumber_array[$i];
 
-                     $data['limit'] = $limit_array[$i];
 
-                     $data['special'] = $special_array[$i];
 
-                     $data['status'] = 1;
 
-                     $data['recruit_id'] = $recruit_id;
 
-                     RecruitPost::create($data);
 
-                 }
 
-             }
 
-             if (!empty($fileCharater)) {
 
-                 foreach ($fileCharater as $f => $fv) {
 
-                     $picpath = 'recruit/' . date('Ymd', time()) . '/';
 
-                     //获取文件的扩展名
 
-                     $ext = $fv->getClientOriginalExtension();
 
-                     //获取文件的绝对路径
 
-                     $path = $fv->getRealPath();
 
-                     //定义文件名
 
-                     $filename = time() . rand(100, 999) . '.' . $ext;
 
-                     //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置
 
-                     Storage::disk('public')->put($picpath . $filename, file_get_contents($path));
 
-                     $data = $picpath . $filename;
 
-                     $create_arr = [
 
-                         'recruit_id' => $recruit_id,
 
-                         'subjoin_name' => $fv->getClientOriginalName(),
 
-                         'subjoin_path' => $data,
 
-                         'subjoin_addtime' => time()
 
-                     ];
 
-                     RecruitSubjoin::create($create_arr);
 
-                 }
 
-             }
 
-             DB::commit();//检查数据库事务
 
-         } catch (\Exception $e) {
 
-             DB::rollback();
 
-             dd($e->getMessage());die;
 
-             return admin_toastr($e->getMessage(), 'error');
 
-         }
 
-     }
 
-     /**
 
-      * 更新报名场次信息
 
-      * @param $id
 
-      * @param Request $request
 
-      */
 
-     public function update($id, Request $request)
 
-     {
 
-         $verify = $this->Form()->getValidateInput();//这个方法会调用Form自带的验证和表单处理(文件上传等)验证错误会直接返回错误.不需要判断;
 
-         $postCode = $request->input('postcode', []);
 
-         $postName = $request->input('postname', []);
 
-         if (count($postCode) == 0 or (count($postCode) >= 1 and $postCode[0] == null)) {
 
-             return admin_toastr('请填写招考岗位', 'error');
 
-         }
 
-         if (count($postName) == 0 or (count($postName) >= 1 and $postName[0] == null)) {
 
-             return admin_toastr('请填写招考岗位名称', 'error');
 
-         }
 
-         $recruit_id = $id;
 
-         $recruit = Recruit::find($id);
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         $data = [];
 
-         $data['name'] = $verify['name'];
 
-         $data['company'] = $verify['company'];
 
-         $data['name_en'] = (array_key_exists('name_en',$verify) && !empty($verify['name_en'])) ? $verify['name_en'] : uniqid();
 
-         if(array_key_exists('small_img',$verify)){
 
-             $data['small_img'] = $verify['small_img'];
 
-         }else{
 
-             $data['small_img'] = theme_asset('app/images/index/recruit_index.jpg');
 
-         }
 
-         $data['status'] = $verify['status'];
 
-         $data['show_report'] = $verify['show_report'];
 
-         $data['current'] = $verify['current'];
 
-         $data['step'] = implode(',',array_filter($verify['step']));
 
-         $data['apply_start'] = $verify['apply_start'] ? $verify['apply_start'] : null;//报名时间
 
-         $data['apply_end'] = $verify['apply_end'] ? $verify['apply_end'] : null;
 
-         $data['audit_start'] = $verify['audit_start'] ? $verify['audit_start'] : null;//审核时间
 
-         $data['audit_end'] = $verify['audit_end'] ? $verify['audit_end'] : null;
 
-         $data['preliminary_start'] = $verify['preliminary_start'] ? $verify['preliminary_start'] : null;//笔试时间
 
-         $data['preliminary_end'] = $verify['preliminary_end'] ? $verify['preliminary_end'] : null;
 
-         $data['computer_start'] = $verify['computer_start'] ? $verify['computer_start'] : null;//上机时间
 
-         $data['computer_end'] = $verify['computer_end'] ? $verify['computer_end'] : null;
 
-         $data['interview_start'] = $verify['interview_start'] ? $verify['interview_start'] : null;//面试时间
 
-         $data['interview_end'] = $verify['interview_end'] ? $verify['interview_end'] : null;
 
-         $data['reexamine_start'] = $verify['reexamine_start'] ? $verify['reexamine_start'] : null;//复试时间
 
-         $data['reexamine_end'] = $verify['reexamine_end'] ? $verify['reexamine_end'] : null;
 
-         $data['health_start'] = $verify['health_start'] ? $verify['health_start'] : null;//体检时间
 
-         $data['health_end'] = $verify['health_end'] ? $verify['health_end'] : null;
 
-         $data['political_start'] = $verify['political_start'] ? $verify['political_start'] : null;//政审时间
 
-         $data['political_end'] = $verify['political_end'] ? $verify['political_end'] : null;
 
-         $data['publicity_start'] = $verify['publicity_start'] ? $verify['publicity_start'] : null;//公示时间
 
-         $data['publicity_end'] = $verify['publicity_end'] ? $verify['publicity_end'] : null;
 
-         $data['supplement_start'] = $verify['supplement_start'] ? $verify['supplement_start'] : null;
 
-         $data['supplement_end'] = $verify['supplement_end'] ? $verify['supplement_end'] : null;
 
-         $data['introduction'] = $verify['introduction'];
 
-         $data['host_address'] = $verify['host_address'];
 
-         if(array_key_exists('chengnuoshu',$verify)){
 
-             $data['chengnuoshu'] = $verify['chengnuoshu'];
 
-         }
 
-         //$data['addFile'] = $verify['addFile'];
 
-         $data['contact'] = $verify['contact'];
 
-         $data['phone'] = $verify['phone'];
 
-         $data['ordid'] = $verify['ordid'];
 
-         $data['limit_times'] = $verify['limit_times'];
 
-         $data['post_times'] = $verify['post_times'];
 
-         $data['pay_switch'] = $verify['pay_switch'];
 
-         $data['special_condition_type'] = $verify['special_condition_type'];
 
-         $data['special_condition_value'] = $verify['special_condition_value'];
 
-         $data['forms'] = implode(',',array_filter($verify['forms']));
 
-         $data['pen_ticket_type'] = $verify['pen_ticket_type'];
 
-         if(array_key_exists('pen_ticket_content',$verify)){
 
-             $data['pen_ticket_content'] = $verify['pen_ticket_content'];
 
-         }
 
-         $data['pen_ticket_field'] = implode(',',$verify['pen_ticket_field']);
 
-         $data['pen_comfirm'] = $verify['pen_comfirm'];
 
-         $data['pen_comfirm_start'] = $verify['pen_comfirm_start'] ? $verify['pen_comfirm_start'] : null;
 
-         $data['pen_comfirm_end'] = $verify['pen_comfirm_end'] ? $verify['pen_comfirm_end'] : null;
 
-         $data['pen_epidemic'] = $verify['pen_epidemic'];
 
-         $data['pen_health'] = $verify['pen_health'];
 
-         $data['pen_health_start'] = $verify['pen_health_start'] ? $verify['pen_health_start'] : null;
 
-         $data['pen_health_end'] = $verify['pen_health_end'] ? $verify['pen_health_end'] : null;
 
-         $data['computer_ticket_type'] = $verify['computer_ticket_type'];
 
-         if(array_key_exists('computer_ticket_content',$verify)){
 
-             $data['computer_ticket_content'] = $verify['computer_ticket_content'];
 
-         }
 
-         $data['computer_ticket_field'] = implode(',',$verify['computer_ticket_field']);
 
-         $data['face_ticket_type'] = $verify['face_ticket_type'];
 
-         if(array_key_exists('face_ticket_content',$verify)){
 
-             $data['face_ticket_content'] = $verify['face_ticket_content'];
 
-         }
 
-         $data['face_ticket_field'] = implode(',',$verify['face_ticket_field']);
 
-         $data['face_epidemic'] = $verify['face_epidemic'];
 
-         $data['face_health'] = $verify['face_health'];
 
-         $data['face_health_start'] = $verify['face_health_start'] ? $verify['face_health_start'] : null;
 
-         $data['face_health_end'] = $verify['face_health_end'] ? $verify['face_health_end'] : null;
 
-         $data['reexamine_ticket_type'] = $verify['reexamine_ticket_type'];
 
-         if(array_key_exists('reexamine_ticket_content',$verify)){
 
-             $data['reexamine_ticket_content'] = $verify['reexamine_ticket_content'];
 
-         }
 
-         $data['reexamine_field'] = implode(',',$verify['reexamine_field']);
 
-         $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id');
 
-         $fileCharater = $request->input('addFile');
 
-         $data['special'] = 0;
 
-         DB::beginTransaction();//检查数据库事务
 
-         try {
 
-             $res = Recruit::where('id', $recruit_id)->update($data);
 
-             $postcode_array = $request->postcode;
 
-             $postname_array = $request->postname;
 
-             $postnumber_array = $request->postnumber;
 
-             $limit_array = $request->postlimit;
 
-             $special_array = $request->postspecial;
 
-             $postid_arr = $request->postid_arr;
 
-             $countnum = count($postcode_array);
 
-             if ($countnum > 0) {
 
-                 $ids = RecruitPost::where('recruit_id', $recruit_id)->pluck('id');
 
-                 if (count($postid_arr) == 0) {//没有提交岗位代表删除岗位
 
-                     RecruitPost::where('recruit_id', $recruit_id)->delete();
 
-                 } else {
 
-                     foreach ($ids as $key => $value) {
 
-                         if (!in_array($value, $postid_arr)) {
 
-                             $post_is_create = RecruitAppointInfo::where('post_id', $value)->first();
 
-                             if (empty($post_is_create)) {
 
-                                 //有报名信息的岗位不能删除
 
-                                 RecruitPost::destroy($value);
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 for ($i = 0; $i < $countnum; $i++) {
 
-                     $data = array();
 
-                     if ($postcode_array[$i] !== '' and $postname_array[$i] !== '') {
 
-                         if (isset($postid_arr[$i])) {
 
-                             $post_id = $postid_arr[$i];
 
-                             $data['code'] = $postcode_array[$i];
 
-                             $data['name'] = $postname_array[$i];
 
-                             $data['number'] = $postnumber_array[$i];
 
-                             $data['limit'] = $limit_array[$i];
 
-                             $data['special'] = $special_array[$i];
 
-                             $data['recruit_id'] = $recruit_id;
 
-                             RecruitPost::where('id', $post_id)->update($data);
 
-                         } else {
 
-                             $data['code'] = $postcode_array[$i];
 
-                             $data['name'] = $postname_array[$i];
 
-                             $data['number'] = $postnumber_array[$i];
 
-                             $data['limit'] = $limit_array[$i];
 
-                             $data['special'] = $special_array[$i];
 
-                             $data['recruit_id'] = $recruit_id;
 
-                             RecruitPost::create($data);
 
-                         }
 
-                     }
 
-                 }
 
-             } else {
 
-                 RecruitPost::where('recruit_id', $recruit_id)->delete();
 
-             }
 
-             $fileCharater = $request->file('addFile');
 
-             if (!empty($fileCharater)) {
 
-                 RecruitSubjoin::where('recruit_id', $recruit_id)->delete();
 
-                 foreach ($fileCharater as $f => $fv) {
 
-                     $picpath = 'zhaokaopic/' . date('Ymd', time()) . '/';
 
-                     //获取文件的扩展名
 
-                     $ext = $fv->getClientOriginalExtension();
 
-                     //获取文件的绝对路径
 
-                     $path = $fv->getRealPath();
 
-                     //定义文件名
 
-                     $filename = time() . rand(100, 999) . '.' . $ext;
 
-                     //存储文件。disk里面的public。总的来说,就是调用disk模块里的public配置
 
-                     Storage::disk('public')->put($picpath . $filename, file_get_contents($path));
 
-                     $data = $picpath . $filename;
 
-                     $create_arr = [
 
-                         'recruit_id' => $recruit_id,
 
-                         'subjoin_name' => $fv->getClientOriginalName(),
 
-                         'subjoin_path' => $data,
 
-                         'subjoin_addtime' => time()
 
-                     ];
 
-                     RecruitSubjoin::create($create_arr);
 
-                 }
 
-             }
 
-             DB::commit();
 
-             return admin_toastr('操作成功!', 'success');
 
-         } catch (\Exception $e) {
 
-             DB::rollback();
 
-             return admin_toastr($e->getMessage(), 'error');
 
-         }
 
-     }
 
-     /**
 
-      * 删掉指定招考场次
 
-      * @param $id
 
-      */
 
-     public function destroy($id)
 
-     {
 
-         Permission::check('recruit_manager_del');
 
-         $info = Recruit::find($id);
 
-         if($info){
 
-             if($info->special){
 
-                 $this->show();
 
-             }
 
-             if($info->delete()){
 
-                 //RecruitAppointInfo::where('recruit_id', $id)->delete();  //todo保留
 
-                 return response()->json(['status' => 1, 'message' => '删除成功!'], '200');
 
-             }else{
 
-                 return response()->json(['status' => 0, 'message' => '删除失败!'], '200');
 
-             }
 
-         }else{
 
-             return response()->json(['status' => 0, 'message' => '找不到记录!'], '200');
 
-         }
 
-         //Recruit::find($id)->delete();
 
-     }
 
-     /**
 
-      * 报名管理
 
-      * @param Content $content
 
-      * @param Request $request
 
-      * @return Content|\Illuminate\Http\RedirectResponse
 
-      */
 
-     public function appointList(Content $content, Request $request)
 
-     {
 
-         Permission::check('recruit_appoint_list');
 
-         $id = $request->id;
 
-         $recruit = Recruit::find($id);
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         if (empty($recruit)) {
 
-             return back();
 
-         }
 
-         $search_data = $request->all();
 
-         $where = [];
 
-         $where[] = ['audit','>',0];
 
-         if (isset($search_data['id']) || session('manage_search_data')['id']) {
 
-             if (isset($search_data['page'])) {
 
-                 if (session('search_data')) {
 
-                     $where = session('managewhere');
 
-                     unset($search_data['page']);
 
-                     $search_data = session('manage_search_data');
 
-                 }
 
-             }
 
-             foreach ($search_data as $k => $v) {
 
-                 if ($k == 'realname') {
 
-                     $where[] = [$k, 'like', "%$v%"];
 
-                 } elseif ($k == 'id') {
 
-                     $where[] = ['recruit_appoint_info.recruit_id', '=', $v];
 
-                 } elseif($k == 'print_bs'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 1];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif($k == 'print_js'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 2];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif($k == 'print_ms'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 3];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif ($k != '_pjax' and $k != 'page' && $k != 'perpage') {
 
-                     $where[] = [$k, '=', $v];
 
-                 }
 
-             }
 
-             session(['managewhere' => $where]);
 
-             session(['manage_search_data' => $search_data]);
 
-             session()->save();
 
-         }
 
-         $session_data = session('search_data');
 
-         if(isset($session_data['perpage'])){
 
-             $perpage = $session_data['perpage'];
 
-         }else{
 
-             $perpage = 20;
 
-         }
 
-         $list = RecruitAppointInfo::where($where)
 
-             ->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left')
 
-             ->join('recruit_ticket', 'recruit_ticket.appoint_id', '=', 'recruit_appoint_info.id','left')
 
-             ->select('recruit_appoint_info.*', 'recruit_post.code', 'recruit_post.name')
 
-             ->orderBy('recruit_appoint_info.updated_at','desc')
 
-             ->paginate($perpage);
 
-         foreach ($list as $k => $v){
 
-             if($v->sex == 0){
 
-                 $list[$k]['sex'] = '女';
 
-             }else{
 
-                 $list[$k]['sex'] = '男';
 
-             }
 
-             switch ($v->political_affiliation){
 
-                 case '01':
 
-                     $list[$k]['political_affiliation'] = '中共党员';
 
-                     break;
 
-                 case '02':
 
-                     $list[$k]['political_affiliation'] = '中共预备党员';
 
-                     break;
 
-                 case '03':
 
-                     $list[$k]['political_affiliation'] = '共青团员';
 
-                     break;
 
-                 case '04':
 
-                     $list[$k]['political_affiliation'] = '民革党员';
 
-                     break;
 
-                 case '05':
 
-                     $list[$k]['political_affiliation'] = '民盟盟员';
 
-                     break;
 
-                 case '06':
 
-                     $list[$k]['political_affiliation'] = '民建会员';
 
-                     break;
 
-                 case '07':
 
-                     $list[$k]['political_affiliation'] = '民进会员';
 
-                     break;
 
-                 case '08':
 
-                     $list[$k]['political_affiliation'] = '农工党党员';
 
-                     break;
 
-                 case '09':
 
-                     $list[$k]['political_affiliation'] = '致公党党员';
 
-                     break;
 
-                 case '10':
 
-                     $list[$k]['political_affiliation'] = '九三学社社员';
 
-                     break;
 
-                 case '11':
 
-                     $list[$k]['political_affiliation'] = '台盟盟员';
 
-                     break;
 
-                 case '12':
 
-                     $list[$k]['political_affiliation'] = '无党派人士';
 
-                     break;
 
-                 case '13':
 
-                     $list[$k]['political_affiliation'] = '群众';
 
-                     break;
 
-             }
 
-             $list[$k]['pen_print'] = 0;
 
-             $list[$k]['computer_print'] = 0;
 
-             $list[$k]['face_print'] = 0;
 
-             $list[$k]['reexamine_print'] = 0;
 
-             $tickets = RecruitTicket::where('appoint_id',$v->id)->get();
 
-             if($tickets){
 
-                 foreach ($tickets as $tk => $tv){
 
-                     if($tv->ex_type == 1){
 
-                         $list[$k]['pen_print'] = $tv->ex_status;
 
-                     }
 
-                     if($tv->ex_type == 2){
 
-                         $list[$k]['computer_print'] = $tv->ex_status;
 
-                     }
 
-                     if($tv->ex_type == 3){
 
-                         $list[$k]['face_print'] = $tv->ex_status;
 
-                     }
 
-                     if($tv->ex_type == 4){
 
-                         $list[$k]['reexamine_print'] = $tv->ex_status;
 
-                     }
 
-                 }
 
-             }
 
-         }
 
-         $post_data = RecruitPost::where('recruit_id',$id)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-         return $content
 
-             ->header('报名管理')
 
-             ->description('招考人员信息列表')
 
-             ->body(view('admin.recruit.appoint_list')->with([
 
-                 'list' => $list,
 
-                 'search_data' => $search_data,
 
-                 'recruit' => $recruit,
 
-                 'post' => $post_data
 
-             ]));
 
-     }
 
-     /**
 
-      * 查看报名详细信息
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      * @throws \Throwable
 
-      */
 
-     public function getUserinfo(Request $request)
 
-     {
 
-         Permission::check('recruit_getUserinfo');
 
-         $id = $request->id;
 
-         $data = RecruitAppointInfo::where('recruit_appoint_info.id',$id)
 
-             ->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left')
 
-             ->join('recruit_appoint_expand_special', 'recruit_appoint_info.id', '=', 'recruit_appoint_expand_special.recruit_appoint_id', 'left')
 
-             ->join('recruit_appoint_detail', 'recruit_appoint_detail.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left')
 
-             ->select('recruit_appoint_info.*', 'recruit_post.name', 'recruit_post.code', 'recruit_appoint_detail.train', 'recruit_appoint_detail.rewards_and_punishments', 'recruit_appoint_detail.introduce', 'recruit_appoint_expand_special.point_apply', 'recruit_appoint_expand_special.condition', 'recruit_appoint_expand_special.point', 'recruit_appoint_expand_special.material')
 
-             ->first();
 
-         $recruit = Recruit::where('id',$data->recruit_id)->first();
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         $recruit->forms = explode(',', $recruit->forms);
 
-         $data->family = json_decode($data->family);
 
-         if ($data->family) {
 
-             foreach ($data->family as $k => $v) {
 
-                 $v->political_affiliation = RecruitAppointInfo::$political_affiliation[$v->political_affiliation];
 
-             }
 
-         }
 
-         //layer相册层
 
-         $photos = [
 
-             'material'=>[],
 
-             'identification'=>[],
 
-             'education_certification'=>[],
 
-             'other_certification'=>[],
 
-             'hj_certification'=>[],
 
-         ];
 
-         if(in_array('expand_special',$recruit->forms)){
 
-             if(json_decode($data->material)){
 
-                 $data->material = json_decode($data->material);
 
-                 $photo_data = [];
 
-                 foreach ($data->material as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['material'] = [
 
-                     'title' => '申请加分佐证材料',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->material = [];
 
-             }
 
-         }
 
-         if(in_array('identification',$recruit->forms)){
 
-             if(json_decode($data->identification)){
 
-                 $data->identification = json_decode($data->identification);
 
-                 $photo_data = [];
 
-                 foreach ($data->identification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['identification'] = [
 
-                     'title' => '身份证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->identification = [];
 
-             }
 
-         }
 
-         if(in_array('education_certification',$recruit->forms)){
 
-             if(json_decode($data->education_certification)){
 
-                 $data->education_certification = json_decode($data->education_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->education_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['education_certification'] = [
 
-                     'title' => '学历证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->education_certification = [];
 
-             }
 
-         }
 
-         if(in_array('other_certification',$recruit->forms)){
 
-             if(json_decode($data->other_certification)){
 
-                 $data->other_certification = json_decode($data->other_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->other_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['other_certification'] = [
 
-                     'title' => '其他证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->other_certification = [];
 
-             }
 
-         }
 
-         if(in_array('hj_certification',$recruit->forms)){
 
-             if(json_decode($data->hj_certification)){
 
-                 $data->hj_certification = json_decode($data->hj_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->hj_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['hj_certification'] = [
 
-                     'title' => '户籍证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->hj_certification = [];
 
-             }
 
-         }
 
-         if(in_array('chengnuoshu',$recruit->forms)){
 
-             if(json_decode($data->chengnuoshu)){
 
-                 $data->chengnuoshu = json_decode($data->chengnuoshu);
 
-                 $photo_data = [];
 
-                 foreach ($data->chengnuoshu as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['chengnuoshu'] = [
 
-                     'title' => '诚信承诺书',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->chengnuoshu = [];
 
-             }
 
-         }
 
-         if(in_array('shixin',$recruit->forms)){
 
-             if(json_decode($data->shixin)){
 
-                 $data->shixin = json_decode($data->shixin);
 
-                 $photo_data = [];
 
-                 foreach ($data->shixin as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['shixin'] = [
 
-                     'title' => '失信被执行人查询信息页扫描件',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->shixin = [];
 
-             }
 
-         }
 
-         if(in_array('baokaoshengming',$recruit->forms)){
 
-             if(json_decode($data->baokaoshengming)){
 
-                 $data->baokaoshengming = json_decode($data->baokaoshengming);
 
-                 $photo_data = [];
 
-                 foreach ($data->baokaoshengming as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['baokaoshengming'] = [
 
-                     'title' => '报考声明书',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->baokaoshengming = [];
 
-             }
 
-         }
 
-         $html = view('admin.recruit.manageajax_userinfo')->with(['appointinfo' => $data,'recruit' => $recruit,'photos'=>$photos])->render();
 
-         return response()->json(['code' => 1, 'data' => $html]);
 
-     }
 
-     /**
 
-      * 第一阶段(报名审核)
 
-      * @param Request $request
 
-      * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response
 
-      * @throws \Throwable
 
-      */
 
-     public function ajax_audit(Request $request)
 
-     {
 
-         Permission::check('recruit_ajax_audit');
 
-         $ids = $request->ids;
 
-         $view_data['ids'] = $ids;
 
-         return response(['data' => view('admin.recruit.ajax_audit')->with($view_data)->render(), 'status' => 1], '200');
 
-     }
 
-     /**
 
-      * 材料补登审核
 
-      * @param Request $request
 
-      * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response
 
-      * @throws \Throwable
 
-      */
 
-     public function ajax_supplement(Request $request)
 
-     {
 
-         Permission::check('recruit_ajax_supplement');
 
-         $ids = $request->ids;
 
-         $view_data['ids'] = $ids;
 
-         $info = RecruitSupplement::where('appoint_id',$ids)->where('type','supplement')->first();
 
-         if(!$info){
 
-             $view_data['switch'] = 0;
 
-             $view_data['photos'] = [
 
-                 'identification'=>[],
 
-                 'household_register' => [],
 
-                 'education_certification'=>[],
 
-                 'family_planning'=>[],
 
-                 'chengxin' => [],
 
-                 'manage' => []
 
-             ];
 
-         }else{
 
-             $view_data['switch'] = 1;
 
-             $photos = [
 
-                 'identification'=>[],
 
-                 'household_register' => [],
 
-                 'education_certification'=>[],
 
-                 'family_planning'=>[],
 
-                 'chengxin' => [],
 
-                 'manage' => []
 
-             ];
 
-             $info->identification = json_decode($info->identification);
 
-             $photo_data = [];
 
-             if(is_array($info->identification) && count($info->identification) > 0){
 
-                 foreach ($info->identification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['identification'] = [
 
-                 'title' => '身份证明',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $info->household_register = json_decode($info->household_register);
 
-             $photo_data = [];
 
-             if(is_array($info->household_register)  && count($info->household_register) > 0){
 
-                 foreach ($info->household_register as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['household_register'] = [
 
-                 'title' => '户口簿',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $info->education_certification = json_decode($info->education_certification);
 
-             $photo_data = [];
 
-             if(is_array($info->education_certification)  && count($info->education_certification) > 0){
 
-                 foreach ($info->education_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['education_certification'] = [
 
-                 'title' => '教育证明',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
- //            $info->family_planning = json_decode($info->family_planning);
 
- //            $photo_data = [];
 
- //            foreach ($info->family_planning as $k => $v) {
 
- //                if($v->status){
 
- //                    $photo_data[] = [
 
- //                        'alt' => $v->name,
 
- //                        'pid' => $v->uid,
 
- //                        'src' => $v->response->path,
 
- //                    ];
 
- //                }
 
- //            }
 
- //            $photos['family_planning'] = [
 
- //                'title' => '计生证明',
 
- //                'id' => 1,
 
- //                'start' => 0,
 
- //                'data' =>$photo_data
 
- //            ];
 
-             $info->chengxin = json_decode($info->chengxin);
 
-             $photo_data = [];
 
-             if(is_array($info->chengxin) && count($info->chengxin) > 0){
 
-                 foreach ($info->chengxin as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['chengxin'] = [
 
-                 'title' => '失信查询情况',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $info->manage = json_decode($info->manage);
 
-             $photo_data = [];
 
-             if(is_array($info->manage) && count($info->manage) > 0){
 
-                 foreach ($info->manage as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['manage'] = [
 
-                 'title' => '综治证明',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $view_data['info'] = $info;
 
-             $view_data['photos'] = $photos;
 
-         }
 
-         return response(['data' => view('admin.recruit.ajax_supplement')->with($view_data)->render(), 'status' => 1], '200');
 
-     }
 
-     /**
 
-      * 健康信息审核
 
-      * @param Request $request
 
-      * @return \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|mixed|\Psr\Container\ContainerInterface|\Symfony\Component\HttpFoundation\Response|\think\Response
 
-      * @throws \Throwable
 
-      */
 
-     public function ajax_health(Request $request)
 
-     {
 
-         Permission::check('recruit_ajax_health');
 
-         $ids = $request->ids;
 
-         $type = $request->type;
 
-         $view_data['ids'] = $ids;
 
-         $info = RecruitSupplement::where('appoint_id',$ids)->where("type",$type)->first();
 
-         $view_data['type'] = $type;
 
-         if(!$info){
 
-             $view_data['switch'] = 0;
 
-             $view_data['photos'] = [];
 
-         }else{
 
-             $view_data['switch'] = 1;
 
-             $photos = [
 
-                 'health_code'=>[],
 
-                 'trip_code' => []
 
-             ];
 
-             $info->health_code = json_decode($info->health_code);
 
-             $photo_data = [];
 
-             if(is_array($info->health_code)){
 
-                 foreach ($info->health_code as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['health_code'] = [
 
-                 'title' => '健康码',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $info->trip_code = json_decode($info->trip_code);
 
-             $photo_data = [];
 
-             if(is_array($info->trip_code)){
 
-                 foreach ($info->trip_code as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-             }
 
-             $photos['trip_code'] = [
 
-                 'title' => '行程码',
 
-                 'id' => 1,
 
-                 'start' => 0,
 
-                 'data' =>$photo_data
 
-             ];
 
-             $view_data['info'] = $info;
 
-             $view_data['photos'] = $photos;
 
-         }
 
-         return response(['data' => view('admin.recruit.ajax_health')->with($view_data)->render(), 'status' => 1], '200');
 
-     }
 
-     /**
 
-      * 报名记录审核处理
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      */
 
-     public function appoint_audit(Request $request)
 
-     {
 
-         $ids = $request->ids;
 
-         if (!is_array($ids)) {
 
-             $ids = explode(",", $ids);
 
-         }
 
-         if (empty($ids)) {
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200');
 
-         }
 
-         $audit = $request->audit;
 
-         $exam_flow_path = $request->exam_flow_path;
 
-         $reason = $request->reason;
 
-         if(empty($audit)){
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200');
 
-         }
 
-         if($audit == '3' && empty($exam_flow_path)){
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核后的考试流程!'], '200');
 
-         }
 
-         if($audit != '3' && empty($reason)){
 
-             return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200');
 
-         }
 
-         $message = [];
 
-         switch ($audit){
 
-             case '1':
 
-                 //撤回至未审核
 
-                 foreach ($ids as $k => $v){
 
-                     $appointinfo = RecruitAppointInfo::where('id', $v)->first();
 
-                     $recruit = Recruit::find($appointinfo->recruit_id);
 
-                     if($recruit->special){
 
-                         continue;
 
-                     }
 
-                     if(!$appointinfo || intval($appointinfo->audit) === 1){
 
-                         continue;
 
-                     }
 
-                     //设置该报名的各个状态
 
-                     $appointinfo_data = [
 
-                         'current' => 1,
 
-                         'audit' =>  1,
 
-                         'pen_audit' => -1,
 
-                         'computer_audit' => -1,
 
-                         'face_audit' => -1,
 
-                         'reexamine_audit' => -1,
 
-                         'inspect_audit' => -1,
 
-                         'political_audit' => -1,
 
-                         'employ_audit' => -1
 
-                     ];
 
-                     RecruitAppointInfo::where('id', $v)->update($appointinfo_data);
 
-                     //写日志
 
-                     $log = [
 
-                         'type'  =>  2,
 
-                         'step' => 1,
 
-                         'appoint_id' => $v,
 
-                         'uid' => Admin::user()->id,
 
-                         'log' => '撤回至未审核状态,原因是:'.$reason
 
-                     ];
 
-                     RecruitAppointLog::create($log);
 
-                     $message[$v] = '您此次的报名需要重新审核,原因是:'.$reason;
 
-                 }
 
-                 break;
 
-             case '2':
 
-                 //审核未通过
 
-                 foreach ($ids as $k => $v){
 
-                     $appointinfo = RecruitAppointInfo::where('id', $v)->first();
 
-                     $recruit = Recruit::find($appointinfo->recruit_id);
 
-                     if($recruit->special){
 
-                         continue;
 
-                     }
 
-                     if(!$appointinfo || intval($appointinfo->audit) === 2){
 
-                         continue;
 
-                     }
 
-                     //设置该报名的各个状态
 
-                     $appointinfo_data = [
 
-                         'current' => 1,
 
-                         'audit' =>  2,
 
-                         'pen_audit' => -1,
 
-                         'computer_audit' => -1,
 
-                         'face_audit' => -1,
 
-                         'reexamine_audit' => -1,
 
-                         'inspect_audit' => -1,
 
-                         'political_audit' => -1,
 
-                         'employ_audit' => -1
 
-                     ];
 
-                     RecruitAppointInfo::where('id', $v)->update($appointinfo_data);
 
-                     //写日志
 
-                     $log = [
 
-                         'type'  =>  2,
 
-                         'step' => 1,
 
-                         'appoint_id' => $v,
 
-                         'uid' => Admin::user()->id,
 
-                         'log' => '审核未通过,原因是:'.$reason
 
-                     ];
 
-                     RecruitAppointLog::create($log);
 
-                     $message[$v] = '您此次报名审核未通过,原因是:'.$reason;
 
-                     $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason));
 
-                 }
 
-                 break;
 
-             case '3':
 
-                 //审核通过
 
-                 foreach ($ids as $k => $v){
 
-                     $appointinfo = RecruitAppointInfo::where('id', $v)->first();
 
-                     $recruit = Recruit::find($appointinfo->recruit_id);
 
-                     if($recruit->special){
 
-                         continue;
 
-                     }
 
-                     if(!$appointinfo || intval($appointinfo->audit) === 3){
 
-                         continue;
 
-                     }
 
-                     $recruit = Recruit::where('id',$appointinfo->recruit_id)->first();
 
-                     $step = explode(',',$recruit->step);
 
-                     $step_str = [
 
-                         'pen' => '未设置此条报名记录的笔试信息',
 
-                     ];
 
-                     if(in_array('3',$step)){
 
-                         //场次有设置笔试
 
-                         if(in_array('pen',$exam_flow_path)){
 
-                             $step_str['pen'] = '该场次需要笔试,已设置此条报考需要参与笔试';
 
-                             $pen_audit = -1;
 
-                         }else{
 
-                             $step_str['pen'] = '该场次需要笔试,此条报考可跳过笔试';
 
-                             $pen_audit = 3;
 
-                         }
 
-                     }else{
 
-                         $step_str['pen'] = '该场次不需要笔试';
 
-                         $pen_audit = 3;
 
-                     }
 
-                     if(in_array('4',$step)){
 
-                         //场次有设置上机
 
-                         if(in_array('computer',$exam_flow_path)){
 
-                             $step_str['computer'] = '该场次需要上机,已设置此条报考需要参与上机';
 
-                             $computer_audit = -1;
 
-                         }else{
 
-                             $step_str['computer'] = '该场次需要上机,此条报考可跳过上机';
 
-                             $computer_audit = 3;
 
-                         }
 
-                     }else{
 
-                         $step_str['computer'] = '该场次不需要上机';
 
-                         $computer_audit = 3;
 
-                     }
 
-                     if(in_array('5',$step)){
 
-                         //场次有设置上机
 
-                         if(in_array('face',$exam_flow_path)){
 
-                             $step_str['face'] = '该场次需要面试,已设置此条报考需要参与面试';
 
-                             $face_audit = -1;
 
-                         }else{
 
-                             $step_str['face'] = '该场次需要面试,此条报考可跳过面试';
 
-                             $face_audit = 3;
 
-                         }
 
-                     }else{
 
-                         $step_str['face'] = '该场次不需要面试';
 
-                         $face_audit = 3;
 
-                     }
 
-                     if(in_array('6',$step)){
 
-                         //场次有设置复试
 
-                         if(in_array('reexamine',$exam_flow_path)){
 
-                             $step_str['reexamine'] = '该场次需要复试,已设置此条报考需要参与复试';
 
-                             $reexamine_audit = -1;
 
-                         }else{
 
-                             $step_str['reexamine'] = '该场次需要复试,此条报考可跳过复试';
 
-                             $reexamine_audit = 3;
 
-                         }
 
-                     }else{
 
-                         $step_str['reexamine'] = '该场次不需要复试';
 
-                         $reexamine_audit = 3;
 
-                     }
 
-                     //设置该报名的各个状态
 
-                     $appointinfo_data = [
 
-                         'current' => 2,//审核成功后进入考试流程
 
-                         'audit' =>  3,
 
-                         'pen_audit' => $pen_audit,
 
-                         'computer_audit' => $computer_audit,
 
-                         'face_audit' => $face_audit,
 
-                         'reexamine_audit' => $reexamine_audit,
 
-                         'inspect_audit' => -1,
 
-                         'political_audit' => -1,
 
-                         'employ_audit' => -1
 
-                     ];
 
-                     RecruitAppointInfo::where('id', $v)->update($appointinfo_data);
 
-                     $reason = $reason ?? '符合报考条件,资格审核将贯穿招聘全程。';
 
-                     //写日志
 
-                     $log = [
 
-                         'type'  =>  2,
 
-                         'step' => 1,
 
-                         'appoint_id' => $v,
 
-                         'uid' => Admin::user()->id,
 
-                         'log' => '审核通过,原因是:' . $reason,
 
-                         'admin_log' => implode(';',$step_str)
 
-                     ];
 
-                     RecruitAppointLog::create($log);
 
-                     $message[$v] = '您此次报名审核已通过,原因是:' . $reason;
 
-                     $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason));
 
-                     $this->fetch_word(['recruit_id'=>$appointinfo->recruit_id,'appoint_id'=>$appointinfo->id]);
 
-                 }
 
-                 break;
 
-         }
 
-         //站内信
 
-         foreach ($ids as $key => $val) {
 
-             if(array_key_exists($val,$message)){
 
-                 $user_info = Member::where('id', $appointinfo->uid)->first();
 
-                 Pms::write_pmsnotice($user_info->id, $user_info->username, $message[$val]);
 
-             }else{
 
-                 continue;
 
-             }
 
-         }
 
-         return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']);
 
-     }
 
-     /**
 
-      * 材料补登审核处理
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      */
 
-     public function supplement(Request $request)
 
-     {
 
-         Permission::check('ajax_supplement');
 
-         $ids = $request->ids;
 
-         if (empty($ids)) {
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200');
 
-         }
 
-         $status = $request->status;
 
-         $reason = $request->reason;
 
-         if(empty($status)){
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200');
 
-         }
 
-         if($status == -1 && empty($reason)){
 
-             return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200');
 
-         }
 
-         if($status == -1){
 
-             $info = RecruitSupplement::where('appoint_id', $ids)->where('type','supplement')->first();
 
-             $appointinfo = RecruitAppointInfo::where('id', $ids)->first();
 
-             //写日志
 
-             $log = [
 
-                 'type'  =>  2,
 
-                 'step' => 1,
 
-                 'appoint_id' => $ids,
 
-                 'uid' => Admin::user()->id,
 
-                 'log' => '材料补登审核未通过,原因是:'.$reason
 
-             ];
 
-             RecruitAppointLog::create($log);
 
-             $info->status = -1;
 
-             $info->msg = $reason;
 
-             $info->save();
 
-             $appointinfo->political_audit = 0;
 
-             $appointinfo->save();
 
-             $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason));
 
-         }
 
-         if($status == 1){
 
-             $reason = $reason ?? '符合报考条件,资格审核将贯穿招聘全程。';
 
-             $info = RecruitSupplement::where('appoint_id', $ids)->where('type','supplement')->first();
 
-             $appointinfo = RecruitAppointInfo::where('id', $ids)->first();
 
-             //写日志
 
-             $log = [
 
-                 'type'  =>  2,
 
-                 'step' => 1,
 
-                 'appoint_id' => $ids,
 
-                 'uid' => Admin::user()->id,
 
-                 'log' => '审核通过,原因是:' . $reason
 
-             ];
 
-             RecruitAppointLog::create($log);
 
-             $info->status = 1;
 
-             $info->msg = $reason;
 
-             $info->save();
 
-             $appointinfo->political_audit = 1;
 
-             $appointinfo->save();
 
-             $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason));
 
-         }
 
-         return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']);
 
-     }
 
-     /**
 
-      * 健康信息处理
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      */
 
-     public function health(Request $request)
 
-     {
 
-         Permission::check('ajax_health');
 
-         $ids = $request->ids;
 
-         if (empty($ids)) {
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核记录!'], '200');
 
-         }
 
-         $type = $request->type;
 
-         $status = $request->h_status;
 
-         $reason = $request->reason;
 
-         if(empty($status)){
 
-             return response()->json(['status' => 0, 'msg' => '请选择审核状态!'], '200');
 
-         }
 
-         if($status == -1 && empty($reason)){
 
-             return response()->json(['status' => 0, 'msg' => '请输入审核原因!'], '200');
 
-         }
 
-         if($status == -1){
 
-             $info = RecruitSupplement::where('appoint_id', $ids)->where('type',$type)->first();
 
-             $appointinfo = RecruitAppointInfo::where('id', $ids)->first();
 
-             //写日志
 
-             $log = [
 
-                 'type'  =>  2,
 
-                 'step' => 1,
 
-                 'appoint_id' => $ids,
 
-                 'uid' => Admin::user()->id,
 
-                 'log' => '健康信息审核未通过,原因是:'.$reason
 
-             ];
 
-             RecruitAppointLog::create($log);
 
-             $info->h_status = -1;
 
-             $info->h_msg = $reason;
 
-             $info->save();
 
-             $appointinfo->health_audit = 0;
 
-             $appointinfo->save();
 
-             $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_error',array('reason'=>$reason));
 
-         }
 
-         if($status == 1){
 
-             $reason = $reason ?? '健康信息审核通过,请及时打印准考证';
 
-             $info = RecruitSupplement::where('appoint_id', $ids)->where('type',$type)->first();
 
-             $appointinfo = RecruitAppointInfo::where('id', $ids)->first();
 
-             //写日志
 
-             $log = [
 
-                 'type'  =>  2,
 
-                 'step' => 1,
 
-                 'appoint_id' => $ids,
 
-                 'uid' => Admin::user()->id,
 
-                 'log' => '审核通过,原因是:' . $reason
 
-             ];
 
-             RecruitAppointLog::create($log);
 
-             $info->h_status = 1;
 
-             $info->h_msg = $reason;
 
-             $info->save();
 
-             $appointinfo->health_audit = 1;
 
-             $appointinfo->save();
 
-             $this->smsService->sendSms($appointinfo->mobile,'sms_recruit_register_success',array('reason'=>$reason));
 
-         }
 
-         return response()->json(['status' => 1, 'msg' => '操作成功!', 'data' => 'ok']);
 
-     }
 
-     public function fetchWord(Request $request)
 
-     {
 
-         $recruit_id = $request->recruit_id;
 
-         $appoint_id = $request->appoint_id;
 
-         if(!empty($recruit_id) && !empty($appoint_id)){
 
-             $url = $this->fetch_word(['recruit_id'=>$recruit_id,'appoint_id'=>$appoint_id]);
 
-             return response()->json(['status' => 1, 'msg' => '生成Word简历成功!', 'data' => 'ok', 'url' => $url]);
 
-         }else{
 
-             return response()->json(['status' => 0, 'msg' => '参数缺失!', 'data' => 'fail']);
 
-         }
 
-     }
 
-     /**
 
-      * 查看审核日志
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      */
 
-     public function showLog(Request $request)
 
-     {
 
-         Permission::check('recruit_show_log');
 
-         $id = $request->id;
 
-         $logs = RecruitAppointLog::where('appoint_id', $id)->orderBy('created_at', 'desc')->get()->toArray();
 
-         $str = "";
 
-         if ($logs) {
 
-             $str .= "<table class='table'><tr style='background:#F0F8FD'><td>审核时间</td><td>操作级别</td><td>记录类型</td><td>触发操作的人员</td><td>审核描述</td></tr>";
 
-             foreach ($logs as $k => $v) {
 
-                 switch ($v['type']){
 
-                     case '1':
 
-                         $level = '系统级操作';
 
-                         $user = '系统';
 
-                         break;
 
-                     case '2':
 
-                         $level = '审核系列操作';
 
-                         $admin = AdminUser::where('id',$v['uid'])->first();
 
-                         $user = $admin->name;
 
-                         break;
 
-                     case '3':
 
-                         $level = '用户自行操作';
 
-                         $member = Member::where('id',$v['uid'])->first();
 
-                         $user = $member->username;
 
-                         break;
 
-                     case '4':
 
-                         $level = '用户暂存';
 
-                         $member = Member::where('id',$v['uid'])->first();
 
-                         $user = $member->username;
 
-                         break;
 
-                 }
 
-                 switch ($v['step']){
 
-                     case '1':
 
-                         $step = '报名及审核';
 
-                         break;
 
-                     case '2':
 
-                         $step = '笔试';
 
-                         break;
 
-                     case '3':
 
-                         $step = '面试';
 
-                         break;
 
-                     case '4':
 
-                         $step = '上机';
 
-                         break;
 
-                     case '5':
 
-                         $step = '复审';
 
-                         break;
 
-                     case '6':
 
-                         $step = '体检';
 
-                         break;
 
-                     case '7':
 
-                         $step = '政审';
 
-                         break;
 
-                     case '8':
 
-                         $step = '录用';
 
-                         break;
 
-                 }
 
-                 $str .= "<tr><td>" . $v['created_at'] . "</td><td>" . $level . "</td><td>" . $step . "</td><td>" . $user . "</td><td>" . $v['log'] . "</td></tr>\r\n";
 
-             }
 
-             $str .= "</table>";
 
-         } else {
 
-             $str = "抱歉,暂未有审核记录";
 
-         }
 
-         return response()->json(['code' => 1, 'data' => $str]);
 
-     }
 
-     /**
 
-      * 生成word版简历
 
-      * @param null $data
 
-      * @throws \PhpOffice\PhpWord\Exception\CopyFileException
 
-      * @throws \PhpOffice\PhpWord\Exception\CreateTemporaryFileException
 
-      * @throws \PhpOffice\PhpWord\Exception\Exception
 
-      */
 
-     public function fetch_word($data = null)
 
-     {
 
-         if($data != null && array_key_exists('recruit_id',$data) && array_key_exists('appoint_id',$data)){
 
-             $recruit = Recruit::where('id',$data['recruit_id'])->first();
 
-             $appoint = RecruitAppointInfo::where('id',$data['appoint_id'])->first();
 
-             $templateProcessor = new TemplateProcessor(base_path() . '/public/word/example.docx');
 
-             //通过setValue 方法给模板赋值
 
-             $templateProcessor->setValue('title', $recruit->name);
 
-             $templateProcessor->setValue('realname', $appoint->realname);
 
-             $templateProcessor->setValue('realname', $appoint->realname);
 
-             $templateProcessor->setValue('sex', $appoint->sex == 0 ? '女' : '男');
 
-             $templateProcessor->setValue('birthday', $appoint->birthday);
 
-             $templateProcessor->setValue('nation', $appoint->nation);
 
-             $templateProcessor->setValue('native_place', $appoint->native_place);
 
-             $templateProcessor->setValue('card', $appoint->card);
 
-             switch ($appoint->political_affiliation){
 
-                 case '01':
 
-                     $templateProcessor->setValue('political_affiliation', '中共党员');
 
-                     break;
 
-                 case '02':
 
-                     $templateProcessor->setValue('political_affiliation', '中共预备党员');
 
-                     break;
 
-                 case '03':
 
-                     $templateProcessor->setValue('political_affiliation', '共青团员');
 
-                     break;
 
-                 case '04':
 
-                     $templateProcessor->setValue('political_affiliation', '民革党员');
 
-                     break;
 
-                 case '05':
 
-                     $templateProcessor->setValue('political_affiliation', '民盟盟员');
 
-                     break;
 
-                 case '06':
 
-                     $templateProcessor->setValue('political_affiliation', '民建会员');
 
-                     break;
 
-                 case '07':
 
-                     $templateProcessor->setValue('political_affiliation', '民进会员');
 
-                     break;
 
-                 case '08':
 
-                     $templateProcessor->setValue('political_affiliation', '农工党党员');
 
-                     break;
 
-                 case '09':
 
-                     $templateProcessor->setValue('political_affiliation', '致公党党员');
 
-                     break;
 
-                 case '10':
 
-                     $templateProcessor->setValue('political_affiliation', '九三学社社员');
 
-                     break;
 
-                 case '11':
 
-                     $templateProcessor->setValue('political_affiliation', '台盟盟员');
 
-                     break;
 
-                 case '12':
 
-                     $templateProcessor->setValue('political_affiliation', '无党派人士');
 
-                     break;
 
-                 case '13':
 
-                     $templateProcessor->setValue('political_affiliation', '群众');
 
-             }
 
-             $templateProcessor->setValue('join_time', $appoint->join_time);
 
-             $templateProcessor->setValue('house_register', $appoint->house_register);
 
-             switch ($appoint->edu_type){
 
-                 case '1':
 
-                     $templateProcessor->setValue('edu_type', '全日制');
 
-                     break;
 
-                 case '2':
 
-                     $templateProcessor->setValue('edu_type', '在职教育');
 
-                     break;
 
-             }
 
-             $templateProcessor->setValue('education', $appoint->education);
 
-             $templateProcessor->setValue('school', $appoint->school);
 
-             $templateProcessor->setValue('degree', $appoint->degree);
 
-             $templateProcessor->setValue('pro', $appoint->pro);
 
-             $templateProcessor->setValue('mobile', $appoint->mobile);
 
-             $templateProcessor->setValue('email', $appoint->email);
 
-             $templateProcessor->setValue('address', $appoint->address);
 
-             $post_data = RecruitPost::where('id',$appoint->post_id)->first();
 
-             $templateProcessor->setValue('post', $post_data->code . " " . $post_data->name);
 
-             $templateProcessor->setValue('work',  $appoint->work);
 
-             $templateProcessor->setValue('titles',  $appoint->titles);
 
-             $templateProcessor->setValue('concat_name',  $appoint->concat_name);
 
-             $templateProcessor->setValue('concat_mobile',  $appoint->concat_mobile);
 
-             $forms = explode(',', $recruit->forms);
 
-             if(in_array('expand_special',$forms)){
 
-                 $special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$appoint->id)->first();
 
-                 if($special){
 
-                     $templateProcessor->cloneBlock('special_block',1);
 
-                     $templateProcessor->setValue('point_apply', $special->point_apply == 0 ? '否' : '是');
 
-                     $templateProcessor->setValue('condition', $special->condition);
 
-                     if($material = json_decode($special->material)){
 
-                         foreach ($material as $k => $v){
 
-                             $templateProcessor->setImageValue('material#'.($k+1),['src' => 'https://www.jucai.gov.cn/'.$v->url]);
 
-                         }
 
-                     }
 
-                 }else{
 
-                     $templateProcessor->cloneBlock('special_block',0);
 
-                 }
 
-             }else{
 
-                 $templateProcessor->cloneBlock('special_block',0);
 
-             }
 
-             $templateProcessor->setValue('resume',  str_replace("\n",'<w:br/>',$appoint->resume));
 
-             if(in_array('detail',$forms)){
 
-                 $detail = RecruitAppointDetail::where('recruit_appoint_id',$appoint->id)->first();
 
-                 $templateProcessor->cloneBlock('detail_block',1);
 
-                 $templateProcessor->setValue('train',  str_replace("\n",'<w:br/>',$detail->train));
 
-                 $templateProcessor->setValue('rewards_and_punishments',  str_replace("\n",'<w:br/>',$detail->rewards_and_punishments));
 
-                 $templateProcessor->setValue('introduce',  str_replace("\n",'<w:br/>',$detail->introduce));
 
-             }else{
 
-                 $templateProcessor->cloneBlock('detail_block',0);
 
-             }
 
-             if($family = json_decode($appoint->family,true)){
 
-                 $templateProcessor->cloneRow('family_relation',count($family));
 
-                 $i = 1;
 
-                 foreach ($family as $k => $v){
 
-                     $templateProcessor->setValue('family_relation#'.$i, $v['relation']);
 
-                     $templateProcessor->setValue('family_realname#'.$i, $v['realname']);
 
-                     $templateProcessor->setValue('family_birthday#'.$i, $v['birthday']);
 
-                     switch ($v['political_affiliation']){
 
-                         case '01':
 
-                             $political_affiliation = '中共党员';
 
-                             break;
 
-                         case '02':
 
-                             $political_affiliation = '中共预备党员';
 
-                             break;
 
-                         case '03':
 
-                             $political_affiliation = '共青团员';
 
-                             break;
 
-                         case '04':
 
-                             $political_affiliation = '民革党员';
 
-                             break;
 
-                         case '05':
 
-                             $political_affiliation = '民盟盟员';
 
-                             break;
 
-                         case '06':
 
-                             $political_affiliation = '民建会员';
 
-                             break;
 
-                         case '07':
 
-                             $political_affiliation = '民进会员';
 
-                             break;
 
-                         case '08':
 
-                             $political_affiliation = '农工党党员';
 
-                             break;
 
-                         case '09':
 
-                             $political_affiliation = '致公党党员';
 
-                             break;
 
-                         case '10':
 
-                             $political_affiliation = '九三学社社员';
 
-                             break;
 
-                         case '11':
 
-                             $political_affiliation = '台盟盟员';
 
-                             break;
 
-                         case '12':
 
-                             $political_affiliation = '无党派人士';
 
-                             break;
 
-                         case '13':
 
-                             $political_affiliation = '群众';
 
-                     }
 
-                     $templateProcessor->setValue('family_political_affiliation#'.$i, $political_affiliation);
 
-                     $templateProcessor->setValue('family_work#'.$i, $v['work']);
 
-                     $i++;
 
-                 }
 
-             }
 
-             $templateProcessor->setImageValue('avatar',['path' => 'http://www.jucai.gov.cn/'.$appoint->avatar, 'width' => 200, 'height' => 150]);
 
-             $filename = $appoint->realname . '_' . $appoint->card.'_' . $post_data->code . $post_data->name;
 
-             if(!is_dir(base_path() . "/storage/app/public/recruit/word/" . $recruit->name_en . '/' .$appoint->audit)){
 
-                 Storage::makeDirectory("public/recruit/word/{$recruit->name_en}/{$appoint->audit}");
 
-             }
 
-             $word_url = "/{$filename}.docx";
 
-             $appoint->word_url = "/storage/recruit/word/" . $recruit->name_en . '/' .$appoint->audit .$word_url;
 
-             $appoint->save();
 
-             $templateProcessor->saveAs(base_path() . "/storage/app/public/recruit/word/" . $recruit->name_en . '/' .$appoint->audit . $word_url);//另存为
 
-             return "/storage/recruit/word/" . $recruit->name_en . '/' .$appoint->audit .$word_url;
 
-         }
 
-     }
 
-     /**
 
-      * 生成word版简历
 
-      * @param null $data
 
-      * @throws \PhpOffice\PhpWord\Exception\CopyFileException
 
-      * @throws \PhpOffice\PhpWord\Exception\CreateTemporaryFileException
 
-      * @throws \PhpOffice\PhpWord\Exception\Exception
 
-      */
 
-     public function fetch_word_internship($data = null)
 
-     {
 
-         if($data != null && array_key_exists('recruit_id',$data) && array_key_exists('appoint_id',$data)){
 
-             $recruit = Recruit::where('id',$data['recruit_id'])->first();
 
-             $appoint = RecruitAppointInfo::where('id',$data['appoint_id'])->first();
 
-             $templateProcessor = new TemplateProcessor(base_path() . '/public/word/example_internship.docx');
 
-             //通过setValue 方法给模板赋值
 
-             $templateProcessor->setValue('title', $recruit->name);
 
-             $templateProcessor->setValue('realname', $appoint->realname);
 
-             $templateProcessor->setValue('realname', $appoint->realname);
 
-             $templateProcessor->setValue('sex', $appoint->sex == 0 ? '女' : '男');
 
-             $templateProcessor->setValue('birthday', $appoint->birthday);
 
-             $templateProcessor->setValue('nation', $appoint->nation);
 
-             $templateProcessor->setValue('native_place', $appoint->native_place);
 
-             $templateProcessor->setValue('card', $appoint->card);
 
-             switch ($appoint->political_affiliation){
 
-                 case '01':
 
-                     $templateProcessor->setValue('political_affiliation', '中共党员');
 
-                     break;
 
-                 case '02':
 
-                     $templateProcessor->setValue('political_affiliation', '中共预备党员');
 
-                     break;
 
-                 case '03':
 
-                     $templateProcessor->setValue('political_affiliation', '共青团员');
 
-                     break;
 
-                 case '04':
 
-                     $templateProcessor->setValue('political_affiliation', '民革党员');
 
-                     break;
 
-                 case '05':
 
-                     $templateProcessor->setValue('political_affiliation', '民盟盟员');
 
-                     break;
 
-                 case '06':
 
-                     $templateProcessor->setValue('political_affiliation', '民建会员');
 
-                     break;
 
-                 case '07':
 
-                     $templateProcessor->setValue('political_affiliation', '民进会员');
 
-                     break;
 
-                 case '08':
 
-                     $templateProcessor->setValue('political_affiliation', '农工党党员');
 
-                     break;
 
-                 case '09':
 
-                     $templateProcessor->setValue('political_affiliation', '致公党党员');
 
-                     break;
 
-                 case '10':
 
-                     $templateProcessor->setValue('political_affiliation', '九三学社社员');
 
-                     break;
 
-                 case '11':
 
-                     $templateProcessor->setValue('political_affiliation', '台盟盟员');
 
-                     break;
 
-                 case '12':
 
-                     $templateProcessor->setValue('political_affiliation', '无党派人士');
 
-                     break;
 
-                 case '13':
 
-                     $templateProcessor->setValue('political_affiliation', '群众');
 
-             }
 
-             $templateProcessor->setValue('join_time', $appoint->join_time);
 
-             $templateProcessor->setValue('house_register', $appoint->house_register);
 
-             $templateProcessor->setValue('education', $appoint->education);
 
-             $templateProcessor->setValue('school', $appoint->school);
 
-             $templateProcessor->setValue('pro', $appoint->pro);
 
-             $templateProcessor->setValue('adjust', $appoint->adjust == 0 ? '否' : '是');
 
-             $templateProcessor->setValue('mobile', $appoint->mobile);
 
-             $templateProcessor->setValue('email', $appoint->email);
 
-             $templateProcessor->setValue('address', $appoint->address);
 
-             $post_data = RecruitPost::where('id',$appoint->post_id)->first();
 
-             $templateProcessor->setValue('post', $post_data->code . " " . $post_data->name);
 
-             $templateProcessor->setValue('concat_name',  $appoint->concat_name);
 
-             $templateProcessor->setValue('concat_mobile',  $appoint->concat_mobile);
 
-             $forms = explode(',', $recruit->forms);
 
-             $templateProcessor->setValue('resume',  str_replace("\n",'<w:br/>',$appoint->resume));
 
-             $detail = RecruitAppointDetail::where('recruit_appoint_id',$appoint->id)->first();
 
-             $templateProcessor->setValue('train',  str_replace("\n",'<w:br/>',$detail->train));
 
-             $templateProcessor->setValue('rewards_and_punishments',  str_replace("\n",'<w:br/>',$detail->rewards_and_punishments));
 
-             $templateProcessor->setValue('introduce',  str_replace("\n",'<w:br/>',$detail->introduce));
 
-             if($family = json_decode($appoint->family,true)){
 
-                 $templateProcessor->cloneRow('family_relation',count($family));
 
-                 $i = 1;
 
-                 foreach ($family as $k => $v){
 
-                     $templateProcessor->setValue('family_relation#'.$i, $v['relation']);
 
-                     $templateProcessor->setValue('family_realname#'.$i, $v['realname']);
 
-                     $templateProcessor->setValue('family_birthday#'.$i, $v['birthday']);
 
-                     switch ($v['political_affiliation']){
 
-                         case '01':
 
-                             $political_affiliation = '中共党员';
 
-                             break;
 
-                         case '02':
 
-                             $political_affiliation = '中共预备党员';
 
-                             break;
 
-                         case '03':
 
-                             $political_affiliation = '共青团员';
 
-                             break;
 
-                         case '04':
 
-                             $political_affiliation = '民革党员';
 
-                             break;
 
-                         case '05':
 
-                             $political_affiliation = '民盟盟员';
 
-                             break;
 
-                         case '06':
 
-                             $political_affiliation = '民建会员';
 
-                             break;
 
-                         case '07':
 
-                             $political_affiliation = '民进会员';
 
-                             break;
 
-                         case '08':
 
-                             $political_affiliation = '农工党党员';
 
-                             break;
 
-                         case '09':
 
-                             $political_affiliation = '致公党党员';
 
-                             break;
 
-                         case '10':
 
-                             $political_affiliation = '九三学社社员';
 
-                             break;
 
-                         case '11':
 
-                             $political_affiliation = '台盟盟员';
 
-                             break;
 
-                         case '12':
 
-                             $political_affiliation = '无党派人士';
 
-                             break;
 
-                         case '13':
 
-                             $political_affiliation = '群众';
 
-                     }
 
-                     $templateProcessor->setValue('family_political_affiliation#'.$i, $political_affiliation);
 
-                     $templateProcessor->setValue('family_work#'.$i, $v['work']);
 
-                     $i++;
 
-                 }
 
-             }
 
-             $templateProcessor->setImageValue('avatar',['path' => 'http://www.jucai.gov.cn/'.$appoint->avatar, 'width' => 200, 'height' => 150]);
 
-             $filename = $appoint->realname . '_' . $appoint->card.'_' . $post_data->code . $post_data->name;
 
-             if(!is_dir(base_path() . "/storage/app/public/recruit/word/" . $recruit->name_en)){
 
-                 Storage::makeDirectory("public/recruit/word/{$recruit->name_en}");
 
-             }
 
-             $word_url = "/{$filename}.docx";
 
-             $appoint->word_url = "/storage/recruit/word/" . $recruit->name_en .$word_url;
 
-             $appoint->save();
 
-             $templateProcessor->saveAs(base_path() . "/storage/app/public/recruit/word/" . $recruit->name_en . $word_url);//另存为
 
-             return "/storage/recruit/word/" . $recruit->name_en .$word_url;
 
-         }
 
-     }
 
-     /**
 
-      * 将报名资料导出成ZIP压缩包
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      * @throws \Exception
 
-      */
 
-     public function out_zip(Request $request)
 
-     {//TODO 数据太大,无法压缩,得做成异步,现阶段指定导出人员
 
-         Permission::check('recruit_out_excel');
 
-         $recruit_id = $request->id;
 
-         $realname = $request->realname;
 
-         $status = $request->status;
 
-         $recruit = Recruit::find($recruit_id);
 
-         if (empty($recruit)) {
 
-             return response()->json(['status' => 0, 'msg' => '找不到对应的招考场次'], 200);
 
-         }
 
-         //$data = $request->all();
 
-         $where = [];
 
-         if(!empty($status)){
 
-             $where[] = ['recruit_appoint_info.audit','=',$status];
 
-         }
 
-         $where[] = ['recruit_appoint_info.recruit_id', '=', $recruit_id];
 
-         //$where[] = ['recruit_appoint_info.realname', 'in', ['张少鸿','黄财阳','吴嘉伟','何瀚','林方浪','蔡咪咪','曾志雄','叶晓惠','李承恭','林心心','陈雪清','江俊峰']];
 
- //        $param = parse_url($data['where']);
 
- //        parse_str($param['query'],$param);
 
- //        if (is_array($param)) {
 
- //            unset($param['id']);
 
- //            foreach ($param as $k => $v) {
 
- //                if ($k == 'realname') {
 
- //                    $where[] = [$k, 'like', "%$v%"];
 
- //                } elseif ($k != '_pjax' and $k != 'page' && $k != 'perpage') {
 
- //                    $where[] = [$k, '=', $v];
 
- //                }
 
- //            }
 
- //        }
 
-         $select = ['recruit_appoint_info.*', 'recruit_post.code', 'recruit_post.name'];
 
-         if(!empty($realname)){
 
-             $model = RecruitAppointInfo::where($where)->whereIn('recruit_appoint_info.realname',explode(',',$realname))->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left');
 
-         }else{
 
-             $model = RecruitAppointInfo::where($where)->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left');
 
-         }
 
-         if(in_array('expand_special',explode(',', $recruit->forms))){
 
-             $model->join('recruit_appoint_expand_special', 'recruit_appoint_expand_special.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left');
 
-             $special_select = ['recruit_appoint_expand_special.point_apply','recruit_appoint_expand_special.condition','recruit_appoint_expand_special.material'];
 
-             $select = array_merge($select,$special_select);
 
-         }
 
-         if(in_array('detail',explode(',', $recruit->forms))){
 
-             $model->join('recruit_appoint_detail', 'recruit_appoint_detail.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left');
 
-             $detail_select = ['recruit_appoint_detail.train','recruit_appoint_detail.rewards_and_punishments','recruit_appoint_detail.introduce'];
 
-             $select = array_merge($select,$detail_select);
 
-         }
 
-         $list = $model->select($select)
 
-             ->orderBy('recruit_appoint_info.updated_at','desc')
 
-             ->get();
 
-         if(!is_dir(base_path() . "/storage/app/public/recruit/zip")){
 
-             Storage::makeDirectory("public/recruit/zip");
 
-         }
 
-         if (file_exists(base_path() . '/storage/app/public/recruit/zip/' . $recruit->company . '.zip')) {
 
-             unlink(base_path() . '/storage/app/public/recruit/zip/' . $recruit->company . '.zip');
 
-         }
 
-         if($list){
 
-             foreach ($list as $key => $value){
 
-                 $path = base_path() . "/storage/app/public/recruit/zip/{$recruit->company}/{$value->realname}_{$value->card}/";
 
-                 if(!is_dir($path)){
 
-                     Storage::makeDirectory("public/recruit/zip/{$recruit->company}/{$value->realname}_{$value->card}");
 
-                 }
 
-                 if(in_array('expand_special',explode(',', $recruit->forms))){
 
-                     $special = RecruitAppointExpandSpecial::where('recruit_appoint_id',$value->id)->first();
 
-                     $material = json_decode($special['material'],true);
 
-                     if($material){
 
-                         foreach ($material as $k => $v){
 
-                             if(array_key_exists('response',$v) && array_key_exists('path',$v['response'])){
 
-                                 $old_path = base_path() . "/public/" . $v['response']['path'];
 
-                             }else{
 
-                                 $old_path = base_path() . "/public/" . $v['url'];
 
-                             }
 
-                             if (file_exists($old_path)) {
 
-                                 $basename = basename($old_path);
 
-                                 $new_path = $path . $basename; //iconv("UTF-8", "GBK", $p->picture_name);
 
-                                 copy($old_path, $new_path); //拷贝到新目录
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 if(in_array('identification',explode(',', $recruit->forms))){
 
-                     $identification = json_decode($value->identification,true);
 
-                     if($identification){
 
-                         foreach ($identification as $k => $v){
 
-                             if(array_key_exists('response',$v) && array_key_exists('path',$v['response'])){
 
-                                 $old_path = base_path() . "/public/" . $v['response']['path'];
 
-                             }else{
 
-                                 $old_path = base_path() . "/public/" . $v['url'];
 
-                             }
 
-                             if (file_exists($old_path)) {
 
-                                 $basename = basename($old_path);
 
-                                 $new_path = $path . $basename; //iconv("UTF-8", "GBK", $p->picture_name);
 
-                                 copy($old_path, $new_path); //拷贝到新目录
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 if(in_array('education_certification',explode(',', $recruit->forms))){
 
-                     $education_certification = json_decode($value->education_certification,true);
 
-                     if($education_certification){
 
-                         foreach ($education_certification as $k => $v){
 
-                             if(array_key_exists('response',$v) && array_key_exists('path',$v['response'])){
 
-                                 $old_path = base_path() . "/public/" . $v['response']['path'];
 
-                             }else{
 
-                                 $old_path = base_path() . "/public/" . $v['url'];
 
-                             }
 
-                             if (file_exists($old_path)) {
 
-                                 $basename = basename($old_path);
 
-                                 $new_path = $path . $basename; //iconv("UTF-8", "GBK", $p->picture_name);
 
-                                 copy($old_path, $new_path); //拷贝到新目录
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 if(in_array('other_certification',explode(',', $recruit->forms))){
 
-                     $other_certification = json_decode($value->other_certification,true);
 
-                     if($other_certification){
 
-                         foreach ($other_certification as $k => $v){
 
-                             if(array_key_exists('response',$v) && array_key_exists('path',$v['response'])){
 
-                                 $old_path = base_path() . "/public/" . $v['response']['path'];
 
-                             }else{
 
-                                 $old_path = base_path() . "/public/" . $v['url'];
 
-                             }
 
-                             if (file_exists($old_path)) {
 
-                                 $basename = basename($old_path);
 
-                                 $new_path = $path . $basename; //iconv("UTF-8", "GBK", $p->picture_name);
 
-                                 copy($old_path, $new_path); //拷贝到新目录
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 if(in_array('hj_certification',explode(',', $recruit->forms))){
 
-                     $hj_certification = json_decode($value->hj_certification,true);
 
-                     if($hj_certification){
 
-                         foreach ($hj_certification as $k => $v){
 
-                             if(array_key_exists('response',$v) && array_key_exists('path',$v['response'])){
 
-                                 $old_path = base_path() . "/public/" . $v['response']['path'];
 
-                             }else{
 
-                                 $old_path = base_path() . "/public/" . $v['url'];
 
-                             }
 
-                             if (file_exists($old_path)) {
 
-                                 $basename = basename($old_path);
 
-                                 $new_path = $path . $basename; //iconv("UTF-8", "GBK", $p->picture_name);
 
-                                 copy($old_path, $new_path); //拷贝到新目录
 
-                             }
 
-                         }
 
-                     }
 
-                 }
 
-                 if(empty($value->word_url)){
 
-                     $value->word_url = $this->fetch_word(['recruit_id'=>$recruit_id,'appoint_id'=>$value->id]);
 
-                 }
 
-                 copy(base_path() . "/public/" . $value->word_url, $path . basename($value->word_url));
 
-             }
 
-             $savename = base_path() . "/storage/app/public/recruit/zip/{$recruit->company}.zip";
 
-             $zipper = new Zipper();
 
-             $folder = base_path() . "/storage/app/public/recruit/zip/{$recruit->company}/";//$public_path  被压缩的文件名
 
-             $zipper->make($savename)->add($folder)->close();//public_path($reduce_path)  压缩之后的文件名
 
-             header("Content-Type: application/zip");
 
-             header("Content-Transfer-Encoding: Binary");
 
-             header("Content-Length: " . filesize($savename));
 
-             header("Content-Disposition: attachment; filename=\"" . $savename . "\"");
 
-             readfile($savename);
 
-             exit;
 
-             return response()->json(['status' => 1, 'msg' => "/zip/{$recruit->name}.zip" ], 200);
 
-         }else{
 
-             echo '没有搜索到相关人员';die;
 
-             return response()->json(['status' => 0, 'msg' => '没有搜索到相关人员'], 200);
 
-         }
 
-     }
 
-     /**
 
-      * 准考证生成界面
 
-      *
 
-      * @param Content $content
 
-      * @param Request $request
 
-      * @return Content
 
-      */
 
-     public function ticket(Content $content, Request $request)
 
-     {
 
-         $recruit_id = $request->id;
 
-         $recruit = Recruit::find($recruit_id);
 
-         return $content
 
-             ->header('准考证管理')
 
-             ->description('')
 
-             ->body(view('admin.recruit.ticket')->with(['recruit'=>$recruit]));
 
-     }
 
-     /**
 
-      * 导出excel汇总表
 
-      * @param Content $content
 
-      * @param Request $request
 
-      * @return \Illuminate\Http\JsonResponse
 
-      * @throws \PhpOffice\PhpSpreadsheet\Exception
 
-      * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
 
-      */
 
-     public function out_excel(Content $content, Request $request)
 
-     {
 
-         Permission::check('recruit_out_excel');
 
-         $id = $request->id;
 
-         $recruit = Recruit::find($id);
 
-         if (empty($recruit)) {
 
-             return response()->json(['status' => 0, 'msg' => '找不到对应的招考场次'], 200);
 
-         }
 
-         $data = $request->all();
 
-         $where = [];
 
-         $where[] = ['audit','>',0];
 
-         $where[] = ['recruit_appoint_info.recruit_id', '=', $data['id']];
 
-         $param = parse_url($data['where']);
 
-         parse_str($param['query'],$param);
 
-         if (is_array($param)) {
 
-             unset($param['id']);
 
-             foreach ($param as $k => $v) {
 
-                 if ($k == 'realname') {
 
-                     $where[] = [$k, 'like', "%$v%"];
 
-                 } elseif ($k == 'id') {
 
-                     $where[] = ['recruit_appoint_info.recruit_id', '=', $v];
 
-                 } elseif($k == 'print_bs'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 1];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif($k == 'print_js'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 2];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif($k == 'print_ms'){
 
-                     $where[] = ['recruit_ticket.ex_type', '=', 3];
 
-                     $where[] = ['recruit_ticket.ex_status', '=', $v];
 
-                 } elseif ($k != '_pjax' and $k != 'page' && $k != 'perpage') {
 
-                     $where[] = [$k, '=', $v];
 
-                 }
 
-             }
 
-         }
 
-         $select = ['recruit_appoint_info.*', 'recruit_post.code', 'recruit_post.name'];
 
-         $model = RecruitAppointInfo::where($where)->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left')->join('recruit_ticket','recruit_ticket.appoint_id','=','recruit_appoint_info.id','left');
 
-         if(in_array('expand_special',explode(',', $recruit->forms))){
 
-             $model->join('recruit_appoint_expand_special', 'recruit_appoint_expand_special.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left');
 
-             $special_select = ['recruit_appoint_expand_special.point_apply','recruit_appoint_expand_special.condition','recruit_appoint_expand_special.material','recruit_appoint_expand_special.point'];
 
-             $select = array_merge($select,$special_select);
 
-         }
 
-         if(in_array('detail',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-             $model->join('recruit_appoint_detail', 'recruit_appoint_detail.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left');
 
-             $detail_select = ['recruit_appoint_detail.train','recruit_appoint_detail.rewards_and_punishments','recruit_appoint_detail.introduce'];
 
-             $select = array_merge($select,$detail_select);
 
-         }
 
-         $list = $model->select($select)
 
-             ->orderBy('recruit_appoint_info.updated_at','desc')
 
-             ->get();
 
-         if(count($list)){
 
-             $spreadsheet = new Spreadsheet();
 
-             $sheet = $spreadsheet->getActiveSheet();
 
-             if(in_array('internship',explode(',', $recruit->forms))){
 
-                 $header = ['姓名','性别','生日','头像','民族','籍贯','报名岗位','政治面貌','入党时间','户籍所在地','年级','就读院校','所学专业','是否接受调剂','通信地址','身份证号码','联系电话','电子邮箱','紧急联系人','紧急联系电话'];
 
-             }else{
 
-                 $header = ['姓名','性别','生日','头像','民族','籍贯','报考岗位','政治面貌','入党时间','职称或职业资格','现工作单位及职务','户籍所在地','学历','学校','学位','所学专业','通信地址','身份证号码','联系电话','电子邮箱','紧急联系人','紧急联系电话'];
 
-             }
 
-             if(in_array('expand_special',explode(',', $recruit->forms))){
 
-                 $special = ['是否申请加分','加分条件','累计加分值','加分佐证材料'];
 
-                 $header = array_merge($header,$special);
 
-             }
 
-             if(in_array('detail',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-                 $detail = ['个人简历','培训学习经历','奖惩情况','个人介绍'];
 
-             }else{
 
-                 $detail = ['个人简历'];
 
-             }
 
-             $header = array_merge($header,$detail);
 
-             $header[] = '家庭成员及其社会关系';
 
-             if(in_array('identification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-                 $header[] = '身份证明';
 
-             }
 
-             if(in_array('education_certification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-                 $header[] = '学历证明';
 
-             }
 
-             if(in_array('other_certification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-                 $header[] = '其他证明';
 
-             }
 
-             if(in_array('hj_certification',explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))){
 
-                 $header[] = '户籍证明';
 
-             }
 
-             if(in_array('chengnuoshu',explode(',', $recruit->forms))){
 
-                 $header[] = '诚信承诺书';
 
-             }
 
-             if(in_array('shixin',explode(',', $recruit->forms))){
 
-                 $header[] = '失信被执行人查询信息页扫描件';
 
-             }
 
-             if(in_array('baokaoshengming',explode(',', $recruit->forms))){
 
-                 $header[] = '报考声明书';
 
-             }
 
-             $header[] = '审核状态';
 
-             $header[] = '审核意见';
 
- //            if(in_array('3',explode(',', $recruit->step))){
 
- //                $header = array_merge($header,['笔试准考证打印','笔试审核状态','笔试结果']);
 
- //            }
 
- //            if(in_array('4',explode(',', $recruit->step))){
 
- //                $header = array_merge($header,['上机准考证打印','上机审核状态','上机结果']);
 
- //            }
 
-             if($recruit->face_comfirm){
 
-                 $header[] = '面试确认';
 
-             }
 
- //            if(in_array('6',explode(',', $recruit->step))){
 
- //                $header = array_merge($header,['复试准考证打印','复试审核状态','复试结果']);
 
- //            }
 
- //            if(in_array('7',explode(',', $recruit->step))){
 
- //                $header = array_merge($header,['体检审核状态','体检结果']);
 
- //            }
 
- //            if(in_array('8',explode(',', $recruit->step))){
 
- //                $header = array_merge($header,['政审状态','政审结果']);
 
- //            }
 
-             $header[] = 'word简历的下载地址';
 
-             foreach ($header as $key => $value) {
 
-                 $sheet->setCellValueByColumnAndRow($key+1, 1, $value);
 
-             }
 
-             $row = 2;
 
-             $sheet->getStyle('S')->getNumberFormat()->setFormatCode('0');
 
-             $length = count($list);//算出该数组的长度
 
-             $last = $list[$length-1];//取出最后一个数组的值,复制给新变量,-1是因为第一个数组元素下表为0
 
-             unset($list[$length-1]);//将最后一个数组注销
 
-             $list[] = $last;//再将新变量加入到数组里
 
-             $data = [];
 
-             foreach ($list as $k => $v) {
 
-                 switch ($v->political_affiliation) {
 
-                     case '01':
 
-                         $political_affiliation = '中共党员';
 
-                         break;
 
-                     case '02':
 
-                         $political_affiliation = '中共预备党员';
 
-                         break;
 
-                     case '03':
 
-                         $political_affiliation = '共青团员';
 
-                         break;
 
-                     case '04':
 
-                         $political_affiliation = '民革党员';
 
-                         break;
 
-                     case '05':
 
-                         $political_affiliation = '民盟盟员';
 
-                         break;
 
-                     case '06':
 
-                         $political_affiliation = '民建会员';
 
-                         break;
 
-                     case '07':
 
-                         $political_affiliation = '民进会员';
 
-                         break;
 
-                     case '08':
 
-                         $political_affiliation = '农工党党员';
 
-                         break;
 
-                     case '09':
 
-                         $political_affiliation = '致公党党员';
 
-                         break;
 
-                     case '10':
 
-                         $political_affiliation = '九三学社社员';
 
-                         break;
 
-                     case '11':
 
-                         $political_affiliation = '台盟盟员';
 
-                         break;
 
-                     case '12':
 
-                         $political_affiliation = '无党派人士';
 
-                         break;
 
-                     case '13':
 
-                         $political_affiliation = '群众';
 
-                         break;
 
-                     default:
 
-                         $political_affiliation = '未知';
 
-                         break;
 
-                 }
 
-                 if(in_array('internship',explode(',', $recruit->forms))){
 
-                     $header = ['姓名','性别','生日','头像','民族','籍贯','报名岗位','政治面貌','入党时间','户籍所在地','年级','就读院校','所学专业','是否接受调剂','通信地址','身份证号码','联系电话','电子邮箱','紧急联系人','紧急联系电话'];
 
-                     $item = [
 
-                         $v->realname,
 
-                         $v->sex == 0 ? '女' : '男',
 
-                         $v->birthday,
 
-                         "https://www.jucai.gov.cn" . $v->avatar,
 
-                         $v->nation,
 
-                         $v->native_place,
 
-                         $v->code . $v->name,
 
-                         $political_affiliation,
 
-                         $v->join_time,
 
-                         $v->house_register,
 
-                         $v->education,
 
-                         $v->school,
 
-                         $v->pro,
 
-                         $v->adjust == 0 ? '否' : '是',
 
-                         $v->address,
 
-                         '\''.$v->card,
 
-                         $v->mobile,
 
-                         $v->email,
 
-                         $v->concat_name,
 
-                         $v->concat_mobile
 
-                     ];
 
-                 }else{
 
-                     $item = [
 
-                         $v->realname,
 
-                         $v->sex == 0 ? '女' : '男',
 
-                         $v->birthday,
 
-                         "https://www.jucai.gov.cn" . $v->avatar,
 
-                         $v->nation,
 
-                         $v->native_place,
 
-                         $v->code . $v->name,
 
-                         $political_affiliation,
 
-                         $v->join_time,
 
-                         $v->titles,
 
-                         $v->work,
 
-                         $v->house_register,
 
-                         $v->education,
 
-                         $v->school,
 
-                         $v->degree,
 
-                         $v->pro,
 
-                         $v->address,
 
-                         '\''.$v->card,
 
-                         $v->mobile,
 
-                         $v->email,
 
-                         $v->concat_name,
 
-                         $v->concat_mobile
 
-                     ];
 
-                 }
 
-                 if (in_array('expand_special', explode(',', $recruit->forms))) {
 
-                     $material = json_decode($v->material, true);
 
-                     $materials = [];
 
-                     if($material){
 
-                         foreach ($material as $key => $value) {
 
-                             array_push($materials, "https://www.jucai.gov.cn" . $value['response']['path']);
 
-                         }
 
-                     }
 
-                     $special = [
 
-                         $v->point_apply == 0 ? '否' : '是',
 
-                         $v->condition,
 
-                         $v->point,
 
-                         implode("\r\n", $materials)
 
-                     ];
 
-                     $item = array_merge($item, $special);
 
-                 }
 
-                 if (in_array('detail', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
 
-                     $detail = [
 
-                         $v->resume,
 
-                         $v->train,
 
-                         $v->rewards_and_punishments,
 
-                         $v->introduce
 
-                     ];
 
-                 } else {
 
-                     $detail = [$v->resume];
 
-                 }
 
-                 $item = array_merge($item, $detail);
 
-                 $family = json_decode($v->family, true);
 
-                 $familys = [];
 
-                 foreach ($family as $val){
 
-                     switch ($val['political_affiliation']) {
 
-                         case '01':
 
-                             $political_affiliation = '中共党员';
 
-                             break;
 
-                         case '02':
 
-                             $political_affiliation = '中共预备党员';
 
-                             break;
 
-                         case '03':
 
-                             $political_affiliation = '共青团员';
 
-                             break;
 
-                         case '04':
 
-                             $political_affiliation = '民革党员';
 
-                             break;
 
-                         case '05':
 
-                             $political_affiliation = '民盟盟员';
 
-                             break;
 
-                         case '06':
 
-                             $political_affiliation = '民建会员';
 
-                             break;
 
-                         case '07':
 
-                             $political_affiliation = '民进会员';
 
-                             break;
 
-                         case '08':
 
-                             $political_affiliation = '农工党党员';
 
-                             break;
 
-                         case '09':
 
-                             $political_affiliation = '致公党党员';
 
-                             break;
 
-                         case '10':
 
-                             $political_affiliation = '九三学社社员';
 
-                             break;
 
-                         case '11':
 
-                             $political_affiliation = '台盟盟员';
 
-                             break;
 
-                         case '12':
 
-                             $political_affiliation = '无党派人士';
 
-                             break;
 
-                         case '13':
 
-                             $political_affiliation = '群众';
 
-                             break;
 
-                         default:
 
-                             $political_affiliation = '未知';
 
-                             break;
 
-                     }
 
-                     $familys[] = "称谓:" . $val['relation'] . ";姓名:".$val['realname'] . ';生日:'.$val['birthday'].';政治面貌:'.$political_affiliation.';职业:'.$val['work'];
 
-                 }
 
-                 $item[] = implode("\r\n", $familys);
 
-                 if (in_array('identification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
 
-                     $identification = json_decode($v->identification, true);
 
-                     $identifications = [];
 
-                     if(is_array($identification)){
 
-                         foreach ($identification as $val){
 
-                             if(array_key_exists('path', $val['response'])){
 
-                                 array_push($identifications,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $identifications));
 
-                 }
 
-                 if (in_array('education_certification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
 
-                     $education_certification = json_decode($v->education_certification, true);
 
-                     $education_certifications = [];
 
-                     if(is_array($education_certification)){
 
-                         foreach ($education_certification as $val){
 
-                             if(array_key_exists('path', $val['response'])){
 
-                                 array_push($education_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $education_certifications));
 
-                 }
 
-                 if (in_array('other_certification', explode(',', $recruit->forms)) || in_array('internship',explode(',', $recruit->forms))) {
 
-                     $other_certification = json_decode($v->other_certification, true);
 
-                     $other_certifications = [];
 
-                     if(is_array($other_certification)){
 
-                         if($other_certification){
 
-                             foreach ($other_certification as $val){
 
-                                 if(array_key_exists('path', $val['response'])){
 
-                                     array_push($other_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                                 }
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $other_certifications));
 
-                 }
 
-                 if (in_array('hj_certification', explode(',', $recruit->forms))) {
 
-                     $hj_certification = json_decode($v->hj_certification, true);
 
-                     $hj_certifications = [];
 
-                     if(is_array($hj_certification)){
 
-                         if($hj_certification){
 
-                             foreach ($hj_certification as $val){
 
-                                 if(array_key_exists('path', $val['response'])){
 
-                                     array_push($hj_certifications,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                                 }
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $hj_certifications));
 
-                 }
 
-                 if (in_array('chengnuoshu', explode(',', $recruit->forms))) {
 
-                     $chengnuoshu = json_decode($v->chengnuoshu, true);
 
-                     $chengnuoshu = [];
 
-                     if($chengnuoshu){
 
-                         foreach ($chengnuoshu as $val){
 
-                             if(array_key_exists('path', $val['response'])){
 
-                                 array_push($chengnuoshu,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $chengnuoshu));
 
-                 }
 
-                 if (in_array('shixin', explode(',', $recruit->forms))) {
 
-                     $shixin = json_decode($v->shixin, true);
 
-                     $shixin = [];
 
-                     if($shixin){
 
-                         foreach ($shixin as $val){
 
-                             if(array_key_exists('path', $val['response'])){
 
-                                 array_push($shixin,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $shixin));
 
-                 }
 
-                 if (in_array('baokaoshengming', explode(',', $recruit->forms))) {
 
-                     $baokaoshengming = json_decode($v->baokaoshengming, true);
 
-                     $baokaoshengming = [];
 
-                     if($baokaoshengming){
 
-                         foreach ($baokaoshengming as $val){
 
-                             if(array_key_exists('path', $val['response'])){
 
-                                 array_push($baokaoshengming,"https://www.jucai.gov.cn" . $val['response']['path']);
 
-                             }
 
-                         }
 
-                     }
 
-                     array_push($item, implode("\r\n", $baokaoshengming));
 
-                 }
 
-                 switch (intval($v->audit)){
 
-                     case 1:
 
-                         $item[] = '审核中';
 
-                         $item[] = '';
 
-                         break;
 
-                     case 2:
 
-                     case 3:
 
-                         $log = RecruitAppointLog::where('appoint_id', $v->id)->where('step', 1)->where('type', 2)->orderBy('created_at', 'desc')->first();
 
-                         if ($log) {
 
-                             $log_arr = explode(',',$log->log);
 
-                             $item[] = $log_arr[0];
 
-                             unset($log_arr[0]);
 
-                             $item[] = implode(',',$log_arr);
 
-                         } else {
 
-                             $item[] = '';
 
-                             $item[] = '';
 
-                         }
 
-                         break;
 
-                     default:
 
-                         $item[] = '';
 
-                         $item[] = '';
 
-                         break;
 
-                 }
 
-                 if(empty($v->word_url)){
 
-                     $item[] = "暂无";
 
-                 }else{
 
-                     $item[] = "https://www.jucai.gov.cn/" . $v->word_url;
 
-                 }
 
-                 if($recruit->face_comfirm){
 
-                     if($v->face_audit == -2){
 
-                         $item[] = "未确认";
 
-                     }else{
 
-                         $item[] = "已确认";
 
-                     }
 
-                 }
 
-                 array_push($data,$item);
 
-             }
 
-             foreach($data as $k => $v){
 
-                 for ($i = 0;$i<count($v);$i++){
 
-                     if($i == 18 || $i == 19 || $i == 22){
 
-                         $sheet->setCellValueExplicitByColumnAndRow($i+1, $row, $v[$i], DataType::TYPE_STRING);
 
-                     }else{
 
-                         $sheet->setCellValueByColumnAndRow($i+1, $row, $v[$i]);
 
-                     }
 
-                 }
 
-                 $row++;
 
-             }
 
-             $file_name = $recruit->name . date("Y-m-d",time());
 
-             header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
 
-             header('Content-Disposition: attachment;filename="'.$file_name.'.xlsx"');
 
-             header('Cache-Control: max-age=0');
 
-             // If you're serving to IE 9, then the following may be needed
 
-             header('Cache-Control: max-age=1');
 
-             // If you're serving to IE over SSL, then the following may be needed
 
-             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 
-             header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
 
-             header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
 
-             header('Pragma: public'); // HTTP/1.0
 
-             $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
 
-             $writer->save('php://output');
 
-         }else{
 
-             return response()->json(['status' => 0, 'msg' => '没有搜索到相关人员'], 200);
 
-         }
 
-     }
 
-     /**
 
-      * 座位贴
 
-      * @param Content $content
 
-      * @param Request $request
 
-      * @return Content
 
-      */
 
-     public function seat_sticker(Content $content, Request $request){
 
-         $recruit_id = $request->id;
 
-         $list = RecruitAppointInfo::where(['recruit_appoint_info.recruit_id' => $recruit_id,'recruit_appoint_info.audit' => 3, 'recruit_ticket.ex_type' => 1])
 
-             ->join('recruit_ticket', 'recruit_ticket.appoint_id', '=', 'recruit_appoint_info.id','left')
 
-             ->select('recruit_appoint_info.*','recruit_ticket.*')
 
-             ->orderBy('recruit_ticket.ex_room','asc')
 
-             ->orderByRaw('recruit_ticket.ex_seat+0 asc')
 
-             ->get();
 
-         $data = [];
 
-         foreach ($list as $k => $v){
 
-             $place = $v->ex_place == null ? "{$v->ex_room}" : $v->ex_place;
 
-             if(!array_key_exists($place,$data)){
 
-                 $data[$place] = [];
 
-             }
 
-             $room = $v->ex_room == null ? '' : $v->ex_room;
 
-             if(!array_key_exists($room,$data[$place])){
 
-                 $data[$place][$room] = [];
 
-             }
 
-             $item = [
 
-                 'avatar' => $v->avatar,
 
-                 'seat' => $v->ex_seat,
 
-                 'realname' => $v->realname,
 
-                 'number' => $v->ex_number
 
-             ];
 
-             array_push($data[$place][$room],$item);
 
-         }
 
-         //dd($data);
 
-         return $content->body(view('admin.recruit.seat_sticker')->with(['data' => $data]));
 
-     }
 
-     public function sign_table(Content $content, Request $request){
 
-         $recruit_id = $request->id;
 
-         $list = RecruitAppointInfo::where(['recruit_appoint_info.recruit_id' => $recruit_id,'recruit_appoint_info.audit' => 3, 'recruit_ticket.ex_type' => 1])
 
-             ->join('recruit_ticket', 'recruit_ticket.appoint_id', '=', 'recruit_appoint_info.id','left')
 
-             ->select('recruit_appoint_info.*','recruit_ticket.*')
 
-             ->orderBy('recruit_ticket.ex_room','asc')
 
-             ->orderByRaw('recruit_ticket.ex_seat+0 asc')
 
-             ->get();
 
-         $data = [];
 
-         foreach ($list as $k => $v){
 
-             $place = $v->ex_place == null ? "{$v->ex_room}" : $v->ex_place;
 
-             if(!array_key_exists($place,$data)){
 
-                 $data[$place] = [];
 
-             }
 
-             $room = $v->ex_room == null ? '' : $v->ex_room;
 
-             if(!array_key_exists($room,$data[$place])){
 
-                 $data[$place][$room] = [];
 
-             }
 
-             $item = [
 
-                 'avatar' => $v->avatar,
 
-                 'seat' => $v->ex_seat,
 
-                 'realname' => $v->realname
 
-             ];
 
-             array_push($data[$place][$room],$item);
 
-         }
 
-         return $content->body(view('admin.recruit.sign_table')->with(['data' => $data]));
 
-     }
 
-     /**
 
-      * 上传成绩页面
 
-      *
 
-      * @access public
 
-      */
 
-     public function ajax_record(Request $request)
 
-     {
 
-         $recruit_id = $request->input('recruit_id');
 
-         if(!$recruit_id){
 
-             return response()->json(['status' => 0, 'msg' => '请指定招考场次'], 200);
 
-         }
 
-         $recruit = Recruit::where('id',$recruit_id)->first();
 
-         if(empty($recruit)){
 
-             return response()->json(['status' => 0, 'msg' => '找不到对应招考场次'], 200);
 
-         }
 
-         $view_data = [
 
-             'recruit'   =>  $recruit
 
-         ];
 
-         return response(['data' => view('admin.recruit.ajax_record')->with($view_data)->render(), 'status' => 1], '200');
 
-     }
 
-     public function update_record(Request $request)
 
-     {
 
-         $data = $request->all();
 
-         if(!array_key_exists('recruit_id',$data) || !$data['recruit_id']){
 
-             return response()->json(['status' => 0, 'msg' => '请指定招考场次'], 200);
 
-         }
 
-         $recruit = Recruit::where('id',$data['recruit_id'])->first();
 
-         if(empty($recruit)){
 
-             return response()->json(['status' => 0, 'msg' => '找不到对应招考场次'], 200);
 
-         }
 
-         if(array_key_exists('pen_data',$data)){
 
-             $ticket_url = base_path() . "/storage/app/public/recruit/ticket/" . uniqid() . '.xlsx';
 
-             if(move_uploaded_file($_FILES['pen_data']['tmp_name'],$ticket_url)){
 
-                 $spreadsheet = IOFactory::load($ticket_url);
 
-                 $sheet = $spreadsheet->getActiveSheet();
 
-                 $rowCount = $sheet->getHighestRow();
 
-                 $record = [];
 
-                 for($row = 2;$row<=$rowCount;$row++){
 
-                     $record[$sheet->getCell("A{$row}")->getValue()] = [
 
-                         'id' => $sheet->getCell("A{$row}")->getValue(),
 
-                         'realname' => $sheet->getCell("B{$row}")->getValue(),
 
-                         'card' => $sheet->getCell("C{$row}")->getValue(),
 
-                         'ex_number' => $sheet->getCell("E{$row}")->getValue(),
 
-                         'record' => $sheet->getCell("F{$row}")->getValue(),
 
-                         'next' => $sheet->getCell("G{$row}")->getValue()
 
-                     ];
 
-                 }
 
-                 Recruit::where('id',$data['recruit_id'])->update(['pen_status' => 1]);
 
-                 $record = new TicketJob($data['recruit_id'],'pen_result',$record);
 
-                 dispatch($record);
 
-                 return response()->json(['status' => 1, 'msg' => '成绩上传成功'], 200);
 
-             }else{
 
-                 return response()->json(['status' => 0, 'msg' => '成绩上传失败'], 200);
 
-             }
 
-         }
 
-         if(array_key_exists('face_data',$data)){
 
-             $ticket_url = base_path() . "/storage/app/public/recruit/ticket/" . uniqid() . '.xlsx';
 
-             if(move_uploaded_file($_FILES['face_data']['tmp_name'],$ticket_url)){
 
-                 $spreadsheet = IOFactory::load($ticket_url);
 
-                 $sheet = $spreadsheet->getActiveSheet();
 
-                 $rowCount = $sheet->getHighestRow();
 
-                 $record = [];
 
-                 for($row = 2;$row<=$rowCount;$row++){
 
-                     $record[$sheet->getCell("A{$row}")->getValue()] = [
 
-                         'id' => $sheet->getCell("A{$row}")->getValue(),
 
-                         'realname' => $sheet->getCell("B{$row}")->getValue(),
 
-                         'card' => $sheet->getCell("C{$row}")->getValue(),
 
-                         'ex_number' => $sheet->getCell("E{$row}")->getValue(),
 
-                         'record' => $sheet->getCell("F{$row}")->getValue(),
 
-                         'next' => $sheet->getCell("G{$row}")->getValue()
 
-                     ];
 
-                 }
 
-                 Recruit::where('id',$data['recruit_id'])->update(['face_status' => 1]);
 
-                 $record = new TicketJob($data['recruit_id'],'face_result',$record);
 
-                 dispatch($record);
 
-                 return response()->json(['status' => 1, 'msg' => '成绩上传成功'], 200);
 
-             }else{
 
-                 return response()->json(['status' => 0, 'msg' => '成绩上传失败'], 200);
 
-             }
 
-         }
 
-         return response()->json(['status' => 0, 'msg' => '上传成绩失败'], 200);
 
-     }
 
-     public function create_record_template(Request $request){
 
-         $recruit_id = $request->input('recruit_id');
 
-         if(!$recruit_id){
 
-             return response()->json(['status' => 0, 'msg' => '请指定招考场次'], 200);
 
-         }
 
-         $recruit = Recruit::where('id',$recruit_id)->first();
 
-         if(empty($recruit)){
 
-             return response()->json(['status' => 0, 'msg' => '找不到对应招考场次'], 200);
 
-         }
 
-         $type = $request->input('type','pen');
 
-         switch ($type){
 
-             case 'pen':
 
-                 $list = RecruitAppointInfo::where('recruit_appoint_info.recruit_id',$recruit_id)
 
-                     ->where('recruit_appoint_info.audit',3)
 
-                     ->where('recruit_appoint_info.pen_audit',-1)
 
-                     ->join('recruit_ticket', 'recruit_appoint_info.id', '=', 'recruit_ticket.appoint_id')
 
-                     ->select('recruit_appoint_info.*','recruit_ticket.ex_number')->orderBy('post_id','asc')->get();
 
-                 $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                 $data = [];
 
-                 foreach ($list as $k => $v){
 
-                     $item = [
 
-                         $v->id,
 
-                         $v->realname,
 
-                         $v->card,
 
-                         $post_data[$v->post_id],
 
-                         $v->ex_number
 
-                     ];
 
-                     array_push($data,$item);
 
-                 }
 
-                 $spreadsheet = IOFactory::load(base_path() . '/storage/app/public/recruit/ticket/template/record_data_template.xlsx');
 
-                 $sheet = $spreadsheet->getActiveSheet();
 
-                 $row = 2;
 
-                 foreach($data as $k => $v){
 
-                     for ($i = 0;$i<count($v);$i++){
 
-                         if($i == 2 || $i == 4){
 
-                             $sheet->setCellValueExplicitByColumnAndRow($i+1, $row, $v[$i], DataType::TYPE_STRING);
 
-                         }else{
 
-                             $sheet->setCellValueByColumnAndRow($i+1, $row, $v[$i]);
 
-                         }
 
-                     }
 
-                     $row++;
 
-                 }
 
-                 $file_name = $recruit->company . "_成绩表模板";
 
-                 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
 
-                 header('Content-Disposition: attachment;filename="'.$file_name.'.xlsx"');
 
-                 header('Cache-Control: max-age=0');
 
-                 // If you're serving to IE 9, then the following may be needed
 
-                 header('Cache-Control: max-age=1');
 
-                 // If you're serving to IE over SSL, then the following may be needed
 
-                 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 
-                 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
 
-                 header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
 
-                 header('Pragma: public'); // HTTP/1.0
 
-                 $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
 
-                 $writer->save('php://output');
 
-                 break;
 
-             case 'face':
 
-                 $list = RecruitAppointInfo::where('recruit_appoint_info.recruit_id',$recruit_id)
 
-                     ->where('recruit_appoint_info.audit',3)
 
-                     ->where('recruit_appoint_info.face_audit',-1)
 
-                     ->where(function($query){
 
-                         $query->where('recruit_appoint_info.pen_audit',1)
 
-                             ->orWhere('recruit_appoint_info.pen_audit',3);
 
-                     })
 
-                     ->join('recruit_ticket', 'recruit_appoint_info.id', '=', 'recruit_ticket.appoint_id')->select('recruit_appoint_info.*','recruit_ticket.ex_number')->orderBy('post_id','asc')->get();
 
-                 $post_data = RecruitPost::where('recruit_id',$recruit_id)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-                 $data = [];
 
-                 foreach ($list as $k => $v){
 
-                     $item = [
 
-                         $v->id,
 
-                         $v->realname,
 
-                         $v->card,
 
-                         $post_data[$v->post_id],
 
-                         $v->ex_number
 
-                     ];
 
-                     array_push($data,$item);
 
-                 }
 
-                 $spreadsheet = IOFactory::load(base_path() . '/storage/app/public/recruit/ticket/template/record_data_template.xlsx');
 
-                 $sheet = $spreadsheet->getActiveSheet();
 
-                 $row = 2;
 
-                 foreach($data as $k => $v){
 
-                     for ($i = 0;$i<count($v);$i++){
 
-                         if($i == 2 || $i == 4){
 
-                             $sheet->setCellValueExplicitByColumnAndRow($i+1, $row, $v[$i], DataType::TYPE_STRING);
 
-                         }else{
 
-                             $sheet->setCellValueByColumnAndRow($i+1, $row, $v[$i]);
 
-                         }
 
-                     }
 
-                     $row++;
 
-                 }
 
-                 $file_name = $recruit->company . "_成绩表模板";
 
-                 header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
 
-                 header('Content-Disposition: attachment;filename="'.$file_name.'.xlsx"');
 
-                 header('Cache-Control: max-age=0');
 
-                 // If you're serving to IE 9, then the following may be needed
 
-                 header('Cache-Control: max-age=1');
 
-                 // If you're serving to IE over SSL, then the following may be needed
 
-                 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 
-                 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
 
-                 header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
 
-                 header('Pragma: public'); // HTTP/1.0
 
-                 $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
 
-                 $writer->save('php://output');
 
-                 break;
 
-         }
 
-     }
 
-     public function ticket_template(Request $request)
 
-     {
 
-     }
 
-     public function create_ticket(Request $request)
 
-     {
 
-         $data = $request->only('recruit_id','type','channel','content','keys');
 
-         //dd($data);
 
-     }
 
-     public function test(Request $request){
 
-         $list = RecruitSupplement::where('recruit_supplement.status',1)
 
-             ->join('recruit_appoint_info', 'recruit_supplement.appoint_id', '=' , 'recruit_appoint_info.id', 'left')
 
-             ->select('recruit_appoint_info.*')
 
-             ->get();
 
-         $post_data = RecruitPost::where('recruit_id',5)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
-         $header = ['姓名','性别','年龄','联系电话','身份证号码','岗位'];
 
-         $spreadsheet = new Spreadsheet();
 
-         $sheet = $spreadsheet->getActiveSheet();
 
-         foreach ($header as $key => $value) {
 
-             $sheet->setCellValueByColumnAndRow($key+1, 1, $value);
 
-         }
 
-         foreach($list as $k => $v){
 
-             $sheet->setCellValueByColumnAndRow(1, $k+2, $v->realname);
 
-             $sheet->setCellValueByColumnAndRow(2, $k+2, $v->sex == 0 ? '女' : '男');
 
-             $time  = explode('-',$v->birthday);
 
-             $sheet->setCellValueByColumnAndRow(3, $k+2, 2021-$time[0]);
 
-             $sheet->setCellValueExplicitByColumnAndRow(4, $k+2, $v->mobile, DataType::TYPE_STRING);
 
-             $sheet->setCellValueExplicitByColumnAndRow(5, $k+2, $v->card, DataType::TYPE_STRING);
 
-             $sheet->setCellValueByColumnAndRow(6, $k+2, $post_data[$v->post_id]);
 
-         }
 
-         $file_name = '名单';
 
-         header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
 
-         header('Content-Disposition: attachment;filename="'.$file_name.'.xlsx"');
 
-         header('Cache-Control: max-age=0');
 
-         // If you're serving to IE 9, then the following may be needed
 
-         header('Cache-Control: max-age=1');
 
-         // If you're serving to IE over SSL, then the following may be needed
 
-         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
 
-         header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
 
-         header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
 
-         header('Pragma: public'); // HTTP/1.0
 
-         $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
 
-         $writer->save('php://output');
 
-         dd($list);
 
- //        $ids = [6,7,121,47,181,66,108,138,21,212,177,130,114,27,63,31,51];
 
- //        $data = RecruitAppointInfo::whereIn('id',$ids)->get();
 
- //        $post_data = RecruitPost::where('recruit_id',1)->where('status',1)->selectRaw('id, CONCAT(code," ",name) as post')->pluck('post', 'id');
 
- //
 
- //
 
- //        foreach ($data as $k => $v){
 
- //            $templateProcessor = new TemplateProcessor(base_path() . "/storage/app/public/recruit/ticket/template/jjhc_face_ticket.docx");
 
- //            $templateProcessor->setValue('realname', $v->realname);
 
- //            $templateProcessor->setValue('card', $v->card);
 
- //            $templateProcessor->setValue('post', $post_data[$v->post_id]);
 
- //            $name = 'jjhc';
 
- //            $date = '2020-11-30';
 
- //            if(!is_dir(base_path() . "/storage/app/public/recruit/ticket/word/{$date}/{$name}/face")){
 
- //                Storage::makeDirectory("public/recruit/ticket/word/{$date}/{$name}/face");
 
- //            }
 
- //            $filename = $v->realname . '_' . $v->card . '_' . $post_data[$v->post_id];
 
- //            $word_url = base_path() . "/storage/app/public/recruit/ticket/word/{$date}/{$name}/face/" . $filename . '.docx';
 
- //            $templateProcessor->saveAs($word_url);//另存为
 
- //        }
 
- //        $templateProcessor = new TemplateProcessor(base_path() . "/storage/app/public/recruit/ticket/template/jjhc_pen_ticket.docx");
 
- //
 
- //
 
- //        $templateProcessor->setImageValue('avatar',['path' => 'https://www.jucai.gov.cn/storage/-1ae05561c7f32869.jpg', 'width' => 200, 'height' => 150]);
 
- //        $templateProcessor->saveAs(base_path() . "/storage/app/public/recruit/ticket/template/test.docx");//另存为
 
-         //shell_exec('libreoffice6.4 --headless --convert-to pdf:writer_pdf_Export ' . base_path() . "/storage/app/public/recruit/ticket/template/test.docx " . base_path() ."/storage/app/public/recruit/ticket/template/test.pdf");
 
-         //libreoffice --headless --convert-to pdf:writer_pdf_Export /data/wwwroot/jucai/storage/app/public/recruit/word/2020-11-30/jjhc/pen/*.docx --outdir /data/wwwroot/jucai/storage/app/public/recruit/pdf/2020-11-30/jjhc/pen
 
-     }
 
-     public function batchFetchWord(Request $request)
 
-     {
 
-         set_time_limit(0);
 
-         ini_set('memory_limit',-1);
 
-         $recruit_id = $request->recruit_id;
 
-         $audit = $request->audit;
 
-         if(!empty($recruit_id)){
 
-             $where = [['recruit_id','=',$recruit_id]];
 
-             //$where[] = ['word_url','=',''];
 
-             if (!empty($audit)) {
 
-                 if ($audit == 3) {
 
-                     $where[] = ['audit','=',3];
 
-                 } else {
 
-                     $where[] = ['audit','!=',0];
 
-                     $where[] = ['audit','!=',3];
 
-                 }
 
-             } else {
 
-                 $where[] = ['audit','!=',0];
 
-             }
 
-             $list = RecruitAppointInfo::where($where)->pluck('id')->all();
 
-             if (!empty($list)) {
 
-                 foreach ($list as $appoint_id) {
 
-                     $this->fetch_word(['recruit_id'=>$recruit_id,'appoint_id'=>$appoint_id]);
 
-                 }
 
-             }
 
-             return response()->json(['status' => 1, 'msg' => '生成Word简历成功!', 'data' => 'ok']);
 
-         }else{
 
-             return response()->json(['status' => 0, 'msg' => '参数缺失!', 'data' => 'fail']);
 
-         }
 
-     }
 
-     public function check_out_appoint(Request $request,Content $content){
 
-         Permission::check('recruit_getUserinfo');
 
-         Permission::check('recruit_ajax_audit');
 
-         $id = $request->id;
 
-         $data = RecruitAppointInfo::where('recruit_appoint_info.id',$id)
 
-             ->join('recruit_post', 'recruit_appoint_info.post_id', '=', 'recruit_post.id', 'left')
 
-             ->join('recruit_appoint_expand_special', 'recruit_appoint_info.id', '=', 'recruit_appoint_expand_special.recruit_appoint_id', 'left')
 
-             ->join('recruit_appoint_detail', 'recruit_appoint_detail.recruit_appoint_id', '=', 'recruit_appoint_info.id', 'left')
 
-             ->select('recruit_appoint_info.*', 'recruit_post.name', 'recruit_post.code', 'recruit_appoint_detail.train', 'recruit_appoint_detail.rewards_and_punishments', 'recruit_appoint_detail.introduce', 'recruit_appoint_expand_special.point_apply', 'recruit_appoint_expand_special.condition', 'recruit_appoint_expand_special.point', 'recruit_appoint_expand_special.material')
 
-             ->first();
 
-         $recruit = Recruit::where('id',$data->recruit_id)->first();
 
-         $post = RecruitPost::where('recruit_id', $data->recruit_id)->get();
 
-         if($recruit->special){
 
-             $this->show();
 
-         }
 
-         $recruit->forms = explode(',', $recruit->forms);
 
-         $data->family = json_decode($data->family);
 
-         if ($data->family) {
 
-             foreach ($data->family as $k => $v) {
 
-                 $v->political_affiliation = RecruitAppointInfo::$political_affiliation[$v->political_affiliation];
 
-             }
 
-         }
 
-         //layer相册层
 
-         $photos = [
 
-             'material'=>[],
 
-             'identification'=>[],
 
-             'education_certification'=>[],
 
-             'other_certification'=>[],
 
-             'hj_certification'=>[],
 
-         ];
 
-         if(in_array('expand_special',$recruit->forms)){
 
-             if(json_decode($data->material)){
 
-                 $data->material = json_decode($data->material);
 
-                 $photo_data = [];
 
-                 foreach ($data->material as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['material'] = [
 
-                     'title' => '申请加分佐证材料',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->material = [];
 
-             }
 
-         }
 
-         if(in_array('identification',$recruit->forms)){
 
-             if(json_decode($data->identification)){
 
-                 $data->identification = json_decode($data->identification);
 
-                 $photo_data = [];
 
-                 foreach ($data->identification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['identification'] = [
 
-                     'title' => '身份证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->identification = [];
 
-             }
 
-         }
 
-         if(in_array('education_certification',$recruit->forms)){
 
-             if(json_decode($data->education_certification)){
 
-                 $data->education_certification = json_decode($data->education_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->education_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['education_certification'] = [
 
-                     'title' => '学历证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->education_certification = [];
 
-             }
 
-         }
 
-         if(in_array('other_certification',$recruit->forms)){
 
-             if(json_decode($data->other_certification)){
 
-                 $data->other_certification = json_decode($data->other_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->other_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['other_certification'] = [
 
-                     'title' => '其他证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->other_certification = [];
 
-             }
 
-         }
 
-         if(in_array('hj_certification',$recruit->forms)){
 
-             if(json_decode($data->hj_certification)){
 
-                 $data->hj_certification = json_decode($data->hj_certification);
 
-                 $photo_data = [];
 
-                 foreach ($data->hj_certification as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['hj_certification'] = [
 
-                     'title' => '户籍证明',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->hj_certification = [];
 
-             }
 
-         }
 
-         if(in_array('chengnuoshu',$recruit->forms)){
 
-             if(json_decode($data->chengnuoshu)){
 
-                 $data->chengnuoshu = json_decode($data->chengnuoshu);
 
-                 $photo_data = [];
 
-                 foreach ($data->chengnuoshu as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['chengnuoshu'] = [
 
-                     'title' => '诚信承诺书',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->chengnuoshu = [];
 
-             }
 
-         }
 
-         if(in_array('shixin',$recruit->forms)){
 
-             if(json_decode($data->shixin)){
 
-                 $data->shixin = json_decode($data->shixin);
 
-                 $photo_data = [];
 
-                 foreach ($data->shixin as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['shixin'] = [
 
-                     'title' => '失信被执行人查询信息页扫描件',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->shixin = [];
 
-             }
 
-         }
 
-         if(in_array('baokaoshengming',$recruit->forms)){
 
-             if(json_decode($data->baokaoshengming)){
 
-                 $data->baokaoshengming = json_decode($data->baokaoshengming);
 
-                 $photo_data = [];
 
-                 foreach ($data->baokaoshengming as $k => $v) {
 
-                     if($v->status){
 
-                         $photo_data[] = [
 
-                             'alt' => $v->name,
 
-                             'pid' => $v->uid,
 
-                             'src' => $v->response->path,
 
-                         ];
 
-                     }
 
-                 }
 
-                 $photos['baokaoshengming'] = [
 
-                     'title' => '报考声明书',
 
-                     'id' => 1,
 
-                     'start' => 0,
 
-                     'data' =>$photo_data
 
-                 ];
 
-             }else{
 
-                 $data->baokaoshengming = [];
 
-             }
 
-         }
 
-         return $content
 
-             ->header('报名审核管理')
 
-             ->description('报名审核管理')
 
-             ->body(view('admin.recruit.check_out_appoint')->with([
 
-                 'appointinfo' => $data,
 
-                 'recruit' => $recruit,
 
-                 'photos' => $photos,
 
-                 'photos_json' => json_encode($photos),
 
-                 'ids' => $id,
 
-                 'post' => $post
 
-             ]));
 
-     }
 
- }
 
 
  |