categoryService = $categoryService; $this->jobsService = $jobsService; } public function index() { return view('mobile.app.health.recruit.index'); } public function list(Request $request) { //获取分类 $filter_where = [ 'AIX_education' => 100, 'AIX_experience' => 100, 'AIX_wage' => 100, ]; $categories = $this->categoryService->getCategories($filter_where); //过滤条件信息 //默认参数 $param_array = ['health_type', 'keyword', 'wage', 'experience', 'education']; $params = []; if ($request->all()) { foreach ($request->all() as $k => $v) { if (in_array($k, $param_array) && $v) { $params[$k] = $v; } } } //查询条件 $size = 10; $where = [ ['is_health', '=', 1], ]; if (!empty($params['keyword'])) { $where[] = ['jobs_name', 'like', '%' . $params['keyword'] . '%']; } if (!empty($params['wage'])) { $where[] = ['wage', '=', $params['wage']]; } if (!empty($params['experience'])) { $where[] = ['experience', '=', $params['experience']]; } if (!empty($params['education'])) { $where[] = ['education', '=', $params['education']]; } if (!empty($params['health_type'])) { $where[] = ['health_type', '=', $params['health_type']]; } else { $where[] = ['health_type', '=', 1]; $params['health_type'] = 1; } $list = Jobs::where($where)->orderBy('updated_at', 'desc')->paginate($size); if ($list->total() > 0) { $list_items = $this->jobsService->dealjobFilelds($list->items()); } else { $list_items = []; } $mobile_dropload = false; if ($list->total() > $size) { $mobile_dropload = true; } if ($request->ajax()) { if ($list->lastPage() < $list->currentPage()) { return response()->json(['status' => 0]); } return response()->json(['status' => 1, 'data' => view('mobile.app.content.jobs.ajax_job_list', ['params' => $params, 'list_items' => $list_items])->render()]); } $return_data = [ 'categories' => $categories, 'list' => $list, 'list_items' => $list_items, 'params' => $params, 'mobile_dropload' => $mobile_dropload, 'current_url' => \Illuminate\Support\Facades\Request::getRequestUri(), ]; return view('mobile.app.health.recruit.list', $return_data); } public function will() { return view('mobile.app.health.recruit.will'); } public function willSave(Request $request) { $field = ['realname' => '姓名', 'sex' => '性别', 'mobile' => '联系方式', 'attachment' => '简历', 'remark' => '求职意向']; $data = $request->only(array_keys($field)); foreach ($field as $k => $v) { if (empty($data[$k])) { return response()->json(['status' => 0, 'msg' => $v . '不能为空']); } } $check = JyyxAppoint::where('mobile', $data['mobile'])->first(); if (!empty($check)) { return response()->json(['status' => 0, 'msg' => '您已提交过,请勿重复提交']); } JyyxAppoint::create($data); return response()->json(['status' => 1]); } public function quanji() { $district = $this->categoryService->getDefaultDistrict(); return view('mobile.app.health.recruit.quanji', [ 'defaultCity' => $district->defaultCity, ]); } public function quanjiSave(Request $request) { $empty_check = [ 'realname' => '姓名', 'sex' => '性别', 'mobile' => '联系方式', 'birthday' => '出生年份', 'native_place' => '籍贯', 'education' => '学历', 'school' => '毕业学校', 'pro_type' => '专业', 'remark' => '求职意向', ]; $field = array_merge($empty_check, [ 'pro_text' => '具体专业', 'title' => '在校任职', 'attachment' => '简历', ]); $data = $request->only(array_keys($field)); foreach ($empty_check as $k => $v) { if (empty($data[$k])) { return response()->json(['status' => 0, 'msg' => $v . '不能为空']); } } $check = QjwjAppoint::where('mobile', $data['mobile'])->first(); if (!empty($check)) { return response()->json(['status' => 0, 'msg' => '您已提交过,请勿重复提交']); } QjwjAppoint::create($data); return response()->json(['status' => 1]); } public function show(Request $request) { $job_id = $request->input('id'); $job_rst = $this->jobsService->getJobInfo(['id' => $job_id]); //获取job信息 if ($job_rst['status'] == 0) { $back_url = \Illuminate\Support\Facades\URL::previous(); return $this->showMessage($job_rst['error'], $back_url, true, '上一页', '3'); } $job_info = $job_rst['job']; $return_data = [ 'info' => $job_info, ]; return view('mobile.app.health.recruit.show', $return_data); } public function apply(Request $request) { $job_id = $request->input('id'); $job_rst = $this->jobsService->getJobInfo(['id' => $job_id]); //获取job信息 if ($job_rst['status'] == 0) { $back_url = \Illuminate\Support\Facades\URL::previous(); return $this->showMessage($job_rst['error'], $back_url, true, '上一页', '3'); } $job_info = $job_rst['job']; $district = $this->categoryService->getDefaultDistrict(); return view('mobile.app.health.recruit.apply', [ 'defaultCity' => $district->defaultCity, 'info' => $job_info, ]); } public function applySave(Request $request) { $field = [ 'realname' => '姓名', 'sex' => '性别', 'mobile' => '联系方式', 'birthday' => '出生年份', 'native_place' => '籍贯', 'education' => '学历', 'attachment' => '简历', 'remark' => '求职意向', 'job_id' => '岗位', 'company_id' => '公司', ]; $data = $request->only(array_keys($field)); foreach ($field as $k => $v) { if (empty($data[$k])) { return response()->json(['status' => 0, 'msg' => $v . '不能为空']); } } $check = PostAppoint::where('job_id', $data['job_id'])->where('mobile', $data['mobile'])->first(); if (!empty($check)) { return response()->json(['status' => 0, 'msg' => '您已提交过,请勿重复提交']); } PostAppoint::create($data); return response()->json(['status' => 1]); } }