Commit 40282c41334c5cbff2bb7bcc7bccd4df2f1c6600
1 parent
9af7d68e
-Image language fixed
Showing
1 changed file
with
13 additions
and
1 deletions
Show diff stats
common/models/Gallery.php
... | ... | @@ -9,6 +9,8 @@ |
9 | 9 | namespace common\models; |
10 | 10 | |
11 | 11 | use artbox\core\models\Image; |
12 | + use artbox\core\models\Language; | |
13 | + use yii\db\ActiveQuery; | |
12 | 14 | |
13 | 15 | /** |
14 | 16 | * Stub class Gallery |
... | ... | @@ -29,7 +31,17 @@ |
29 | 31 | 'gallery' => true, |
30 | 32 | ] |
31 | 33 | ) |
32 | - ->with('lang') | |
34 | + ->with( | |
35 | + [ | |
36 | + 'lang' => function (ActiveQuery $query) { | |
37 | + $query->andWhere( | |
38 | + [ | |
39 | + 'language_id' => Language::getCurrent()->id, | |
40 | + ] | |
41 | + ); | |
42 | + }, | |
43 | + ] | |
44 | + ) | |
33 | 45 | ->all(); |
34 | 46 | } |
35 | 47 | ... | ... |