Commit 5de17c7c557b6a3e83d0bf761bf674ae1ca54cc7
1 parent
3248e2e0
-Gallery save fixed
Showing
1 changed file
with
11 additions
and
12 deletions
Show diff stats
common/models/Gallery.php
... | ... | @@ -35,19 +35,18 @@ |
35 | 35 | /** |
36 | 36 | * @param array $images |
37 | 37 | */ |
38 | - public function saveImages(array $images) | |
38 | + public function saveImages($images) | |
39 | 39 | { |
40 | - if (empty($images)) { | |
41 | - \Yii::$app->db->createCommand() | |
42 | - ->update( | |
43 | - 'ImageManager', | |
44 | - [ | |
45 | - 'gallery' => false, | |
46 | - ], | |
47 | - '1 = 1' | |
48 | - ) | |
49 | - ->execute(); | |
50 | - } else { | |
40 | + \Yii::$app->db->createCommand() | |
41 | + ->update( | |
42 | + 'ImageManager', | |
43 | + [ | |
44 | + 'gallery' => false, | |
45 | + ], | |
46 | + '1 = 1' | |
47 | + ) | |
48 | + ->execute(); | |
49 | + if (!empty($images)) { | |
51 | 50 | $condition = 'id IN (' . implode(',', $images) . ')'; |
52 | 51 | \Yii::$app->db->createCommand() |
53 | 52 | ->update( | ... | ... |