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.
21 lines
489 B
21 lines
489 B
<?php
|
|
|
|
namespace App\Service\v3\Implementations;
|
|
|
|
use App\Model\v3\Banner;
|
|
use App\Service\v3\Interfaces\BannerServiceInterface;
|
|
|
|
class BannerService implements BannerServiceInterface
|
|
{
|
|
public function all($type, $marketId)
|
|
{
|
|
$builder = Banner::query()
|
|
->where(['type' => $type]);
|
|
|
|
if ($marketId != -1) {
|
|
$builder = $builder->whereJsonContains('market_ids', [(string)$marketId]);
|
|
}
|
|
|
|
return $builder->get()->toArray();
|
|
}
|
|
}
|