@@ -70,9 +70,9 @@ discard block |
||
| 70 | 70 | 'distinct' => false, |
| 71 | 71 | 'join' => [], |
| 72 | 72 | 'order' => [], |
| 73 | - 'start' => isset($options['start']) ? (int)$options['start'] : 0, |
|
| 73 | + 'start' => isset($options['start']) ? (int) $options['start'] : 0, |
|
| 74 | 74 | 'key' => isset($options['key']) ? $options['key'] : null, |
| 75 | - 'limit' => !empty($options['count']) ? (int)$options['count'] : 0, |
|
| 75 | + 'limit' => !empty($options['count']) ? (int) $options['count'] : 0, |
|
| 76 | 76 | ]; |
| 77 | 77 | |
| 78 | 78 | //only not deleted items |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | if (!empty(\App::$cur->Ecommerce->config['view_filter']['options'])) { |
| 135 | 135 | foreach (\App::$cur->Ecommerce->config['view_filter']['options'] as $optionId => $optionValue) { |
| 136 | 136 | $selectOptions['join'][] = [Item\Param::table(), Item::index() . ' = ' . 'option' . $optionId . '.' . Item\Param::colPrefix() . Item::index() . ' AND ' . |
| 137 | - 'option' . $optionId . '.' . Item\Param::colPrefix() . Item\Option::index() . ' = "' . (int)$optionId . '" AND ' . |
|
| 138 | - 'option' . $optionId . '.' . Item\Param::colPrefix() . 'value = "' . (int)$optionValue . '"', |
|
| 137 | + 'option' . $optionId . '.' . Item\Param::colPrefix() . Item\Option::index() . ' = "' . (int) $optionId . '" AND ' . |
|
| 138 | + 'option' . $optionId . '.' . Item\Param::colPrefix() . 'value = "' . (int) $optionValue . '"', |
|
| 139 | 139 | 'inner', 'option' . $optionId]; |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -153,15 +153,15 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | break; |
| 155 | 155 | case 'badge': |
| 156 | - $selectOptions['where'][] = ['item_badge_id', (int)$filter]; |
|
| 156 | + $selectOptions['where'][] = ['item_badge_id', (int) $filter]; |
|
| 157 | 157 | break; |
| 158 | 158 | case 'price': |
| 159 | 159 | $colName = Item\Offer\Price::colPrefix() . 'price'; |
| 160 | 160 | if (!empty($filter['min'])) { |
| 161 | - $selectOptions['where'][] = [$colName, (float)$filter['min'], '>=']; |
|
| 161 | + $selectOptions['where'][] = [$colName, (float) $filter['min'], '>=']; |
|
| 162 | 162 | } |
| 163 | 163 | if (!empty($filter['max'])) { |
| 164 | - $selectOptions['where'][] = [$colName, (float)$filter['max'], '<=']; |
|
| 164 | + $selectOptions['where'][] = [$colName, (float) $filter['max'], '<=']; |
|
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | case 'options': |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | if ($filter) { |
| 181 | 181 | foreach ($filter as $optionId => $optionValue) { |
| 182 | - $optionId = (int)$optionId; |
|
| 182 | + $optionId = (int) $optionId; |
|
| 183 | 183 | if (is_array($optionValue)) { |
| 184 | 184 | $optionValueArr = []; |
| 185 | 185 | foreach ($optionValue as $val) { |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $qstr = '= ' . \App::$cur->db->connection->pdo->quote($optionValue); |
| 191 | 191 | } |
| 192 | 192 | $selectOptions['join'][] = [$table, $itemIndex . ' = ' . 'option' . $optionId . '.' . $paramPrefix . $itemIndex . ' AND ' . |
| 193 | - 'option' . $optionId . '.' . $paramPrefix . $optionIndex . ' = "' . (int)$optionId . '" AND ' . |
|
| 193 | + 'option' . $optionId . '.' . $paramPrefix . $optionIndex . ' = "' . (int) $optionId . '" AND ' . |
|
| 194 | 194 | 'option' . $optionId . '.' . $paramPrefix . 'value ' . $qstr . '', |
| 195 | 195 | 'inner', 'option' . $optionId]; |
| 196 | 196 | } |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | continue; |
| 213 | 213 | } |
| 214 | 214 | $category = Category::get($categoryId); |
| 215 | - $where[] = ['tree_path', $category->tree_path . (int)$categoryId . '/%', 'LIKE', $first ? 'AND' : 'OR']; |
|
| 215 | + $where[] = ['tree_path', $category->tree_path . (int) $categoryId . '/%', 'LIKE', $first ? 'AND' : 'OR']; |
|
| 216 | 216 | $first = false; |
| 217 | 217 | } |
| 218 | 218 | $selectOptions['where'][] = $where; |
| 219 | 219 | } else { |
| 220 | 220 | $category = Category::get($options['parent']); |
| 221 | 221 | if ($category) { |
| 222 | - $selectOptions['where'][] = ['tree_path', $category->tree_path . (int)$options['parent'] . '/%', 'LIKE']; |
|
| 222 | + $selectOptions['where'][] = ['tree_path', $category->tree_path . (int) $options['parent'] . '/%', 'LIKE']; |
|
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | } |
@@ -17,12 +17,12 @@ |
||
| 17 | 17 | <div class="row"> |
| 18 | 18 | <div class="col-sm-7 ecommerce-showoptions-sort"> |
| 19 | 19 | <span class="caption">Сортировка:</span> |
| 20 | - <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['price' => sortToggler('price','asc')]])); ?>">По цене<?= sortDirectionIcon('price'); ?></a> |
|
| 21 | - <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['sales' => sortToggler('sales','desc')]])); ?>">По популярности<?= sortDirectionIcon('sales'); ?></a> |
|
| 20 | + <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['price' => sortToggler('price', 'asc')]])); ?>">По цене<?= sortDirectionIcon('price'); ?></a> |
|
| 21 | + <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['sales' => sortToggler('sales', 'desc')]])); ?>">По популярности<?= sortDirectionIcon('sales'); ?></a> |
|
| 22 | 22 | <?php |
| 23 | 23 | if (!empty(App::$cur->ecommerce->config['isset_sort'])) { |
| 24 | 24 | ?> |
| 25 | - <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['isset' => sortToggler('isset','desc')]])); ?>">По наличию<?= sortDirectionIcon('isset'); ?></a> |
|
| 25 | + <a rel="nofollow" href="<?= $path; ?>?<?= http_build_query(array_merge($query, ['sort' => ['isset' => sortToggler('isset', 'desc')]])); ?>">По наличию<?= sortDirectionIcon('isset'); ?></a> |
|
| 26 | 26 | <?php |
| 27 | 27 | } |
| 28 | 28 | ?> |