BannerFacadeRepository.php 649 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Repositories\Eloquent;
  3. use App\Repositories\Contracts\BannerInterface;
  4. use App\Models\Banner;
  5. /**
  6. *
  7. * @author lilin
  8. *
  9. */
  10. class BannerFacadeRepository extends BaseRepository implements BannerInterface
  11. {
  12. public function getList(array $conditions, array $fields, string $sort, int $page, int $limit)
  13. {
  14. $result = Banner::query()->where(function($query) use($conditions){
  15. if (isset($conditions['local_id'])){
  16. $query->where('local_id', $conditions['local_id']);
  17. }
  18. })->orderByRaw($sort)->paginate($limit, $fields);
  19. return $this->response($result);
  20. }
  21. }