NoticeRepositoryEloquent.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Repositories\Eloquent;
  3. use Prettus\Repository\Eloquent\BaseRepository;
  4. use Prettus\Repository\Criteria\RequestCriteria;
  5. use App\Repositories\NoticeRepository;
  6. use App\Models\Notice;
  7. use App\Validators\NoticeValidator;
  8. /**
  9. * Class NoticeRepositoryEloquent.
  10. *
  11. * @package namespace App\Repositories\Eloquent;
  12. */
  13. class NoticeRepositoryEloquent extends BaseRepository implements NoticeRepository
  14. {
  15. /**
  16. * 查询检索的字段
  17. *
  18. * @return string
  19. */
  20. protected $fieldSearchable = [
  21. 'id' => '=',
  22. 'title' => 'like',
  23. 'show' => '=',
  24. ];
  25. /**
  26. * Specify Model class name
  27. *
  28. * @return string
  29. */
  30. public function model()
  31. {
  32. return Notice::class;
  33. }
  34. /**
  35. * Specify Validator class name
  36. *
  37. * @return mixed
  38. */
  39. public function validator()
  40. {
  41. return NoticeValidator::class;
  42. }
  43. /**
  44. * Boot up the repository, pushing criteria
  45. */
  46. public function boot()
  47. {
  48. // $this->pushCriteria(app(RequestCriteria::class));
  49. }
  50. }