123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- namespace App\Repositories;
- use App\Models\ResumeCredent;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- /**
- * Class MemberRepositoryEloquent.
- *
- * @package namespace App\Repositories;
- */
- class ResumeCredentRepository extends BaseRepository
- {
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return ResumeCredent::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- $this->pushCriteria(app(RequestCriteria::class));
- }
- public function getResumeCredentByResumeId($resume_id)
- {
- return $this->model->where('resume_id', $resume_id)->orderByRaw('year desc,month desc')->get()->toArray();
- }
- public function resumeCredentAdd($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 resumeCredentDelete($id)
- {
- return $this->delete($id);
- }
- public function getResumeCredentCount($resume_id)
- {
- return $this->model->where('resume_id', $resume_id)->count();
- }
- public function getCredentByU($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 getResumeCredent($where)
- {
- return $this->model->where($where)->first();
- }
- }
|