MemberRepositoryEloquent.php 1.1 KB

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