@ -7,9 +7,10 @@ use yii\db\ActiveQuery;
*/
class CustomerQuery extends ActiveQuery
{
public static function active($query)
public function active()
$query->andWhere('status=1');
$this->andWhere('status=1');
return $this;
}
@ -7,9 +7,10 @@ use yii\mongodb\ActiveQuery;
public static function activeOnly($query)
public function activeOnly()
$query->andWhere(['status' => 2]);
$this->andWhere(['status' => 2]);
@ -7,9 +7,10 @@ use yii\sphinx\ActiveQuery;
class ArticleIndexQuery extends ActiveQuery
public static function favoriteAuthor($query)
public function favoriteAuthor()
$query->andWhere('author_id=1');
$this->andWhere('author_id=1');