1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace App\Repositories;
- use App\Models\ViewResume;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- class ViewResumeRepository extends BaseRepository
- {
-
- public function model()
- {
- return ViewResume::class;
- }
-
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
-
- public function getViewResume($resume_id)
- {
- return $this->model->with(['companys','resumes'])->whereIn('resume_id', $resume_id)->whereHas('companys')->whereHas('resumes')->count();
- }
-
- public function browseList($where, $id, $page)
- {
- return $this->model->with('resumes')->where($where)->where('uid', $id)->orderBy('id', 'desc')->paginate($page, ['*']);
- }
-
- 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);
- }
- }
|