123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace common\models\query;
- use common\enums\StatusEnum;
- use common\models\Goods;
- class CatQuery extends \yii\db\ActiveQuery
- {
- public function active()
- {
- return $this->andWhere(['status' => StatusEnum::STATUS_ON, 'is_del' => StatusEnum::STATUS_OFF]);
- }
- public function notDel()
- {
- return $this->andWhere(['is_del' => StatusEnum::STATUS_OFF]);
- }
- public function hot()
- {
- return $this->andWhere(['is_hot' => StatusEnum::STATUS_ON])->active();
- }
-
- public function all($db = null)
- {
- return parent::all($db);
- }
-
- public function one($db = null)
- {
- return parent::one($db);
- }
- }
|