You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
489 B

  1. <?php
  2. namespace App\Service\v3\Implementations;
  3. use App\Model\v3\Banner;
  4. use App\Service\v3\Interfaces\BannerServiceInterface;
  5. class BannerService implements BannerServiceInterface
  6. {
  7. public function all($type, $marketId)
  8. {
  9. $builder = Banner::query()
  10. ->where(['type' => $type]);
  11. if ($marketId != -1) {
  12. $builder = $builder->whereJsonContains('market_ids', [(string)$marketId]);
  13. }
  14. return $builder->get()->toArray();
  15. }
  16. }