categoryService = $categoryService; $this->jobsService = $jobsService; } public function index() { return view('mobile.app.ic.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 = ['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_ic', '=', 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']]; } $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.ic.recruit.list', $return_data); } public function will() { return view('mobile.app.ic.recruit.will'); } public function quanji() { return view('mobile.app.ic.recruit.quanji'); } public function show(Request $request) { $job_id = $request->input('id'); $job_rst = $this->jobsService->getJobInfo(array('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 = array( 'info' => $job_info, ); return view('mobile.app.ic.recruit.show',$return_data); } public function apply() { $district = $this->categoryService->getDefaultDistrict(); return view('mobile.app.ic.recruit.apply', [ 'defaultCity' => $district->defaultCity, ]); } }