pushCriteria(app(RequestCriteria::class)); } public function getJobsApply($data, $where) { return $this->model->with(['resumes','jobs'=>function($query) use($where) { $query->whereIn('audit', $where)->where('display', 1)->where('valid', 1); }])->where($data)->whereHas('resumes')->whereHas('jobs')->orderBy('id', 'desc')->paginate(10); } public function getJobsApplyCount($uid, $where) { return $this->model->with(['resumes','jobs'=>function($query) use ($where) { $query->whereIn('audit', $where)->where('display', 1)->where('valid', 1); }])->where(['personal_uid'=>$uid])->whereHas('resumes')->whereHas('jobs')->count(); } public function delApplyJobs($id) { return $this->model->whereIn('id', $id)->delete(); } public function applyJons($data) { return $this->model->insert($data); } public function personApplyByTime($jobs_id, $uid, $date) { return $this->model->whereIn('jobs_id', $jobs_id)->where('personal_uid', $uid)->where('created_at', '>=', date('Y-m-d H:i:s', strtotime("-{$date} day")))->where('created_at', '<=', date('Y-m-d H:i:s', strtotime("{$date} day")))->get()->toArray(); } public function getTodayCount($uid) { return $this->model->where('personal_uid', $uid)->where('created_at', '>=', date('Y-m-d 00:00:00'))->where('created_at', '<=', date('Y-m-d 23:59:59'))->count(); } }