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.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace common\modules\banners\entities\queries;
|
|
|
|
|
|
|
|
use common\modules\banners\entities\Banner;
|
|
|
|
use yii\db\ActiveQuery;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class BannerQuery
|
|
|
|
*
|
|
|
|
* @see Banner
|
|
|
|
*/
|
|
|
|
class BannerQuery extends ActiveQuery
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return BannerQuery
|
|
|
|
*/
|
|
|
|
public function active()
|
|
|
|
{
|
|
|
|
return $this->andWhere(['active' => Banner::STATUS_ACTIVE]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return BannerQuery
|
|
|
|
*/
|
|
|
|
public function showTime()
|
|
|
|
{
|
|
|
|
return $this->andWhere(['<', 'start_at', time()])->andWhere(['>', 'end_at', time()]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*public function excludeFree()
|
|
|
|
{
|
|
|
|
$current = Url::current([]);
|
|
|
|
return $this->andWhere(['not rlike', 'exclude_urls', '^'.$current.'$']);
|
|
|
|
}*/
|
|
|
|
}
|