mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 02:13:17 +08:00
Fixed scope method signatures
This commit is contained in:
@ -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;
|
||||
*/
|
||||
class CustomerQuery extends ActiveQuery
|
||||
{
|
||||
public static function activeOnly($query)
|
||||
public function activeOnly()
|
||||
{
|
||||
$query->andWhere(['status' => 2]);
|
||||
$this->andWhere(['status' => 2]);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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');
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user