memberInfoService = $memberInfoService; $this->resumeService = $resumeService; $this->smsService = $smsService; $this->authService = $authService; $this->memberService = $memberService; $this->CategoryService = $CategoryService; $this->resumeRepository = $resumeRepository; $this->memberInfoRepository = $memberInfoRepository; $this->companyRepository = $companyRepository; } public function index(){ return view('app.hardware.pad.resume'); } public function cardId(Request $request){ $id_card = $request->cardId; $info = $this->memberInfoService->getInfo( ['id_card' => $id_card]); if(!$info){ return response()->json(['status'=>0, 'msg'=>'暂无简历,请新建...']); } $resumes = $this->resumeRepository->getSuccessResume($info['uid'],getResumeStatus()); if($resumes->isEmpty()){ return response()->json(['status'=>0, 'msg'=>'暂无简历,请新建...']); } $html = ''; $html .= ''; return response()->json(['status'=>1, 'msg'=>'成功','data'=>$resumes,'html'=>$html]); } public function add(Request $request){ $idcard = $request->all(); foreach ($idcard as &$value){ if($value == 'undefined'){ $value = ''; } } if(isset($idcard['androidIdNo'])){ $IdNo = $idcard['androidIdNo']; $idcard['year'] = substr($IdNo, 6, 4); $idcard['age'] = date('Y',time()) - $idcard['year']; $info = $this->memberInfoService->getInfo(['id_card' => $IdNo]); if($info){ $idcard['phone'] = $info['phone']; $idcard['uid'] = $info['uid']; }else{ $idcard['phone'] = ''; $idcard['uid'] = ''; } }elseif(isset($idcard['uid'])){ $idcard['year'] = ''; $idcard['age'] = ''; } $idcard['min_wage'] = config('aix.companyset.comset.com_set.wage_min'); $categorys = $this->CategoryService->getCategories(array('AIX_card_type'=>10)); $idcard['card_t_cn'] = array_pop($categorys['AIX_card_type'])['id']; $district = config('aix.system.site_other.site_other.district'); if($district && substr_count($district,'.') == 1){ $district .= '.0'; }elseif ($district && substr_count($district,'.') == 0){ $district .= '.0.0'; } return view('app.hardware.pad.resume_add',['idcard'=>$idcard,'district'=>$district]); } public function resumeCreate(Request $request){ $data = $request->all(); if(empty($data['uid']) && $this->memberInfoRepository->findMemberInfo(['email'=>$data['email']])){ return response()->json(['status' => 0, 'msg' =>'该邮箱已存在!']); } if($this->companyRepository->getCompanyInfo(['email'=>$data['email']])){ return response()->json(['status' => 0, 'msg' =>'该邮箱已存在!']); } if(empty($data['uid']) && $this->registerMobile($data) == false){ return response()->json(['status' => 0, 'msg' =>'验证码错误']); } if(!$this->resumeService->addPadResume($data)){ return response()->json(['status' => 0, 'msg' =>'新增失败']); } return response()->json(['status' => 1, 'msg' =>'新增成功']); } public function registerMobile($data) { $mobile_code =$data['mobile_code']; $mobile = $data['telephone']; $checkAuthSms = $this->smsService->checkAuthSms($mobile, Smser::TEMPLATE_AUTH_LOGIN, $mobile_code); if (!$checkAuthSms) { return false; } return true; } public function qrCode(Request $request){ $res = hashid_decode($request->hashid); if(!$res){ return response()->json(['status'=>-1, 'msg'=>'二维码出错,请刷新重试...']); } $info = $this->memberInfoService->getInfo(['uid' => $res['id']]); if(!$info){ return response()->json(['status'=>-1, 'msg'=>'二维码出错,请刷新重试...']); } $resumes = $this->resumeRepository->getSuccessResume($info['uid'],getResumeStatus()); if($resumes->isEmpty()){ return response()->json(['status'=>0, 'msg'=>'暂无简历,请新建...','uid'=>$info['uid']]); } $html = ''; $html .= ''; return response()->json(['status'=>1, 'msg'=>'成功','data'=>$resumes,'html'=>$html]); } }