123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- namespace App\Repositories;
- use App\Models\ResumeWork;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- class ResumeWorkRepository extends BaseRepository
- {
-
- public function model()
- {
- return ResumeWork::class;
- }
-
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- public function getResumeWorkByResumeId($resume_id)
- {
- return $this->model->where('resume_id', $resume_id)->orderByRaw('startyear desc,startmonth desc')->get()->toArray();
- }
- public function resumeWorkAdd($date)
- {
- return $this->model->create($date);
- }
- public function getResumeById($id)
- {
- return $this->model->find($id)->toArray();
- }
- public function updateResume($data, $id)
- {
- return $this->update($data, $id);
- }
- public function resumeWorkDelete($id)
- {
- return $this->delete($id);
- }
- public function getResumeWorkCount($resume_id)
- {
- return $this->model->where('resume_id', $resume_id)->count();
- }
- public function getResumeMany($id)
- {
- return $this->model->where('id', $id)->get()->toArray();
- }
- public function getWorkByU($resume_id, $uid)
- {
- return $this->model->where(['resume_id'=>$resume_id, 'uid'=>$uid])->get();
- }
- public function addInsert($date)
- {
- return $this->model->insert($date);
- }
- public function getResumeWorks($where)
- {
- return $this->model->where($where)->get();
- }
- public function getWork($where)
- {
- return $this->model->where($where)->first();
- }
- }
|