model->where($where)->count(); } public function findCompany($where, $offset = 0, $limit = 10) { return $this->model->with(['jobfairout'=>function ($query) { $query->where('showendtime', '>=', time())->orWhere('showendtime', 0); },'companys'])->where($where)->offset($limit*$offset)->limit($limit)->get(); } public function getComList($where) { return $this->model->where($where)->select(['company_id'])->get(); } public function findCom($where) { return $this->model->with(['companys','jobfairPutJob'=>function($query){ $query->with('jobs'); }])->where($where)->first(); } public function jobfairAppointment($where) { return $this->model->where($where)->first(); } public function findList($where) { return $this->model->whereHas('jobfairout')->where($where)->orderby('created_at', 'desc')->paginate(10); } public function getJobfair($com_id) { return $this->model->with(['jobfairout'=>function ($query) { $query->where([['holddate_end', '>', time()]]); }])->whereHas('jobfairout',function ($query){ $query->where([['holddate_end', '>', time()]]); })->where(['company_id'=>$com_id])->where('audit','<>',3)->get(); } public function findJob($where) { return $this->model->with(['jobfairout'=>function ($query) { $query->where('showendtime', '>=', time())->orWhere('showendtime', 0); }])->with('companys')->where($where)->get(); } public function getCount($where, $subsite_id) { return $this->model->when($subsite_id,function ($query) use($subsite_id) { $query->whereHas('jobfairout', function ($query) use($subsite_id) { $query->where($subsite_id); }); })->where($where)->count(); } public function findListOption($com_id) { return $this->model->whereHas('jobfairout')->where(['company_id'=>$com_id])->groupBy('jobfair_id')->orderby('created_at', 'desc')->get(); } public function getPluck($where,$column) { return $this->model->where($where)->pluck($column); } public function getValue($where,$column) { return $this->model->where($where)->value($column); } }