@@ -33,7 +33,7 @@ |
||
33 | 33 | )); |
34 | 34 | $context = stream_context_create($options); |
35 | 35 | echo "<style>.tmg {margin:0 auto}</style>"; |
36 | - echo file_get_contents("http://{$config['domain']}.paykeeper.ru/order/inline/", FALSE, $context); |
|
36 | + echo file_get_contents("http://{$config['domain']}.paykeeper.ru/order/inline/", false, $context); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 |
@@ -236,17 +236,20 @@ |
||
236 | 236 | * @return boolean|\Users\User |
237 | 237 | */ |
238 | 238 | public function get($idn, $ltype = 'id') { |
239 | - if (!$idn) |
|
240 | - return false; |
|
239 | + if (!$idn) { |
|
240 | + return false; |
|
241 | + } |
|
241 | 242 | |
242 | - if (is_numeric($idn) && $ltype != 'login') |
|
243 | - $user = Users\User::get($idn, 'id'); |
|
244 | - elseif ($ltype == 'login') |
|
245 | - $user = Users\User::get($idn, 'login'); |
|
246 | - else |
|
247 | - $user = Users\User::get($idn, 'mail'); |
|
248 | - if (!$user) |
|
249 | - return []; |
|
243 | + if (is_numeric($idn) && $ltype != 'login') { |
|
244 | + $user = Users\User::get($idn, 'id'); |
|
245 | + } elseif ($ltype == 'login') { |
|
246 | + $user = Users\User::get($idn, 'login'); |
|
247 | + } else { |
|
248 | + $user = Users\User::get($idn, 'mail'); |
|
249 | + } |
|
250 | + if (!$user) { |
|
251 | + return []; |
|
252 | + } |
|
250 | 253 | |
251 | 254 | return $user; |
252 | 255 | } |
@@ -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 | } |