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.

37 lines
714 B

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