<?php
/**
 * Created by PhpStorm.
 * User:  NODELOG
 * Date: 16/3/17
 * Time: 上午10:19
 */

namespace common\models\query;


use common\enums\StatusEnum;
use common\models\Article;
use yii\db\ActiveQuery;

class CategoryQuery extends ActiveQuery
{
    /**
     * @param null $db
     * @return array|Article[]
     */
    public function all($db = null)
    {
        return parent::all($db); // TODO: Change the autogenerated stub
    }

    /**
     * @param null $db
     * @return array|null|Article
     */
    public function one($db = null)
    {
        return parent::one($db); // TODO: Change the autogenerated stub
    }


    /**
     * 审核通过的
     */
    public function active()
    {
        return $this->andWhere(['status' => StatusEnum::STATUS_ON, 'is_del' => StatusEnum::STATUS_OFF]);
    }

}