Commit 255c98ce86f7a00871ce1efb2fcfd534af748021
1 parent
51532a3f
- book status
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
frontend/models/SearchModel.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | namespace frontend\models; | 9 | namespace frontend\models; |
| 10 | 10 | ||
| 11 | + use common\models\Book; | ||
| 11 | use yii\base\Model; | 12 | use yii\base\Model; |
| 12 | use yii\db\Expression; | 13 | use yii\db\Expression; |
| 13 | use yii\db\Query; | 14 | use yii\db\Query; |
| @@ -49,6 +50,6 @@ | @@ -49,6 +50,6 @@ | ||
| 49 | if ($this->bookTitle){ | 50 | if ($this->bookTitle){ |
| 50 | $query->orWhere(['ilike', 'secondname', $this->text])->orWhere(['ilike', new Expression('concat(name,\' \',secondname)'), $this->text]); | 51 | $query->orWhere(['ilike', 'secondname', $this->text])->orWhere(['ilike', new Expression('concat(name,\' \',secondname)'), $this->text]); |
| 51 | } | 52 | } |
| 52 | - return $query->column(); | 53 | + return $query->andWhere(['book.stattus' => Book::STATUS_ACTIVE])->column(); |
| 53 | } | 54 | } |
| 54 | } | 55 | } |
| 55 | \ No newline at end of file | 56 | \ No newline at end of file |