diff --git a/common/models/Gallery.php b/common/models/Gallery.php index b5bba74..28f55d8 100644 --- a/common/models/Gallery.php +++ b/common/models/Gallery.php @@ -35,19 +35,18 @@ /** * @param array $images */ - public function saveImages(array $images) + public function saveImages($images) { - if (empty($images)) { - \Yii::$app->db->createCommand() - ->update( - 'ImageManager', - [ - 'gallery' => false, - ], - '1 = 1' - ) - ->execute(); - } else { + \Yii::$app->db->createCommand() + ->update( + 'ImageManager', + [ + 'gallery' => false, + ], + '1 = 1' + ) + ->execute(); + if (!empty($images)) { $condition = 'id IN (' . implode(',', $images) . ')'; \Yii::$app->db->createCommand() ->update( -- libgit2 0.21.4