/** * @return \yii\db\ActiveQuery */ public static function findPublished() { $now = time(); return parent::find()->andWhere("`dateEnd` >= '{$now}' AND `dateStart` <= '{$now}' AND `published` = '1'"); }