123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Repositories\Eloquent;
- use Prettus\Repository\Eloquent\BaseRepository;
- use Prettus\Repository\Criteria\RequestCriteria;
- use App\Repositories\BannerRepository;
- use App\Models\Banner;
- use App\Validators\BannerValidator;
- /**
- * Class BannerRepositoryEloquent.
- *
- * @package namespace App\Repositories\Eloquent;
- */
- class BannerRepositoryEloquent extends BaseRepository implements BannerRepository
- {
- /**
- * 查询检索的字段
- *
- * @return string
- */
- protected $fieldSearchable = [
- 'id' => '=',
- 'show' => '=',
- 'type' => '=',
- 'title' => 'like',
- ];
- /**
- * Specify Model class name
- *
- * @return string
- */
- public function model()
- {
- return Banner::class;
- }
- /**
- * Specify Validator class name
- *
- * @return mixed
- */
- public function validator()
- {
- return BannerValidator::class;
- }
- /**
- * Boot up the repository, pushing criteria
- */
- public function boot()
- {
- // $this->pushCriteria(app(RequestCriteria::class));
- }
- }
|