model->whereHas('jobfairs') ->whereHas('resumes') ->whereHas('putJobs') ->where(['company_id'=>$com_id]) ->where($where) ->orderBy("updated_at", 'desc') ->paginate(10); } public function downResumeDel($ids) { return $this->model->whereIn('id', $ids)->delete(); } public function personJobfair($data, $where, $resumeWhere) { return $this->model->with(['resumes', 'putJobs'=>function ($query) use ($where) { $query->with(['jobs'=>function ($query) use ($where){ $query->whereIn('audit', $where)->where('display', 1); }]); }, 'jobfairs'])->where($data)->whereHas('resumes')->whereHas('putJobs')->whereHas('jobfairs')->orderBy('id', 'desc')->paginate(10); } public function applyJobs($where,$limit = '') { if($limit){ return $this->model->with(['jobfairs','resumes','putJobs'])->whereHas('resumes')->where($where)->paginate($limit); }else{ return $this->model->with(['jobfairs','resumes','putJobs'])->whereHas('resumes')->where($where)->get(); } } public function padApplyJobs($where) { return $this->model->has('resumes')->has('putJobs') ->where($where)->where(function ($query) { $query->where(['is_apply'=>1,'is_interview'=>1]) ->orWhere(['is_apply'=>2]); })->paginate(10); } public function interviewAdd($data) { return $this->model->create($data); } public function interviewEdit($id) { $interview=$this->model->find($id); $interview->is_interview=1; return $interview->save(); } /* * 判断是否已投递 */ public function applyFind($where){ return $res = $this->model->where($where)->first(); } /* * 判断是否已邀请 */ public function interviewFind($where){ $res = $this->model->where($where) ->where(function ($query) { $query->where(['is_apply'=>1,'is_interview'=>1]) ->orWhere(['is_apply'=>2])->first(); })->first(); return $res ? true : false; } //删除 public function delete($where){ return $this->model->where($where)->delete(); } //获取个人所投简历 public function getPersonApply($where,$limit,$page){ return $this->model->with(['putJobs'=>function($query){ $query->with('jobs'); }])->where($where)->paginate($limit,['*'],'page',$page); } public function applyJobsPage($where,$limit,$page) { return $this->model ->with(['jobfairs','resumes','putJobs']) ->where($where)->where(function ($query) { $query->where(['is_apply'=>1,'is_interview'=>1]) ->orWhere(['is_apply'=>2]); })->paginate($limit,['*'],'page',$page); } public function getJobsApply($where) { return $this->model->where($where)->orderBy('id', 'desc')->get(); } public function getResumeJobs($com_id,$where,$where1){ return $this->model ->whereHas('jobfairs') ->whereHas('resumes') ->whereHas('putJobs',function($query) use ($where1){ $query->whereHas('jobs',function($query) use ($where1){ $query->where($where1); }); }) ->where(['company_id'=>$com_id]) ->where($where) ->orderBy("updated_at", 'desc') ->paginate(10); } public function getPluck($where,$colunm) { return $this->model->where($where)->pluck($colunm); } }