| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | <?phpnamespace App\Repositories;use App\Models\ViewResume;use Prettus\Repository\Eloquent\BaseRepository;use Prettus\Repository\Criteria\RequestCriteria;/** * Class MemberRepositoryEloquent. * * @package namespace App\Repositories; */class ViewResumeRepository extends BaseRepository{    /**     * Specify Model class name     *     * @return string     */    public function model()    {        return ViewResume::class;    }    /**     * Boot up the repository, pushing criteria     */    public function boot()    {        $this->pushCriteria(app(RequestCriteria::class));    }    /**     * 获取简历的关注数。     * @param $resume_id     * @return mixed     */    public function getViewResume($resume_id)    {        return $this->model->with(['companys','resumes'])->whereIn('resume_id', $resume_id)->whereHas('companys')->whereHas('resumes')->count();    }    /**浏览过的简历     * @param $where     * @param $page     * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator     */    public function browseList($where, $id, $page)    {        return $this->model->with('resumes')->where($where)->where('uid', $id)->orderBy('id', 'desc')->paginate($page, ['*']);    }    /**删除浏览过的简历     * @param $ids     * @param $company_id     * @return mixed     */    public function browseResumeDel($ids,$company_id)    {        return $this->model->whereIn('id', $ids)->where("uid",$company_id)->delete();    }    //获取简历查看信息    public function findViewResume($where)    {        return $this->model->where($where)->first();    }    public function getAttentMe($where, $resume_id)    {        return $this->model->with(['companys','resumes'])->where($where)->whereIn('resume_id', $resume_id)->whereHas('companys')->whereHas('resumes')->orderBy('id', 'desc')->paginate(10);    }}
 |