pushCriteria(app(RequestCriteria::class)); } public function getDownResume($data) { return $this->model->where($data)->first(); } public function resumeDownDel($ids, $where) { return $this->model->where($where)->whereIn('id', $ids)->delete(); } /**下载简历列表 * @param $where * @param $map * @param $page * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator */ public function downResume($where, $map, $page) { return $this->model->with('resumes')->where($map)->where($where)->orderBy("is_reply", "asc")->orderBy('down_addtime', 'desc')->paginate($page, ['*']); } /**获取简历ID * @param $id * @return mixed */ public function getResumeId($id) { return $this->model->whereIn('id', $id)->select(['resume_id'])->get()->toArray(); } /**企业标记简历 * @param $id * @param $data * @return mixed */ public function companyLabelResume($id, $data) { return $this->model->where('id', $id)->update($data); } //获取已下载简历数量 public function getDownResumeNums($where) { return $this->model->where($where)->count(); } //获取简历下载信息集合 public function getDowmResumes($where, $whereIn = array(), $arr_filed = 'resume_id') { $list = array(); if ($whereIn) { reset($whereIn); $rst = $this->model->where($where)->whereIn(key($whereIn), $whereIn[key($whereIn)])->get(); } else { $rst = $this->model->where($where)->get(); } if ($rst->toArray()) { foreach ($rst as $k => $v) { $list[$v->$arr_filed] = $v; } } return $list; } public function getStateArr() { return $this->model->getStateArr(); } public function updateData($where, $set_data) { return $this->model->where($where)->update($set_data); } public function getDownResumes($where = array(), $orderby = array(), $limit = '') { /*$rst = $this->model->with('resumes')->where($where); if ($orderby) { foreach ($orderby as $k => $v) { $rst->orderBy($k, $v); } } if ($limit) { $rst->limit($limit); } return $rst->get();*/ $rst = $this->model->with('resumes')->whereHas('subsite_resume', function ($query) { $query->where('subsite_id', get_subsite_id());})->where($where); if ($orderby) { foreach ($orderby as $k => $v) { $rst->orderBy($k, $v); } } if ($limit) { $rst->limit($limit); } return $rst->get(); } public function getResumeNumGroup($where, $group_by, $subsite_id) { return $this->model->where($where)->select(DB::raw('count(id),DATE(created_at)'))->when($subsite_id!=-1, function($query) use($subsite_id) { $query->whereHas('companys', function ($query) use($subsite_id) { $query->where(['subsite_id'=>$subsite_id]); }); })->groupBy($group_by)->get(); } public function getPluck($where,$column) { return $this->model->where($where)->pluck($column); } }