@@ -33,7 +33,8 @@ |
||
33 | 33 | \Ecommerce\Warehouse::index() => $warehouse->id, |
34 | 34 | 'count' => $count |
35 | 35 | ]); |
36 | - } else { |
|
36 | + } |
|
37 | + else { |
|
37 | 38 | $warehouseOffer->count = $count; |
38 | 39 | } |
39 | 40 | $warehouseOffer->save(); |
@@ -28,7 +28,8 @@ |
||
28 | 28 | 'count' => $count |
29 | 29 | ]); |
30 | 30 | $warehouse->save(); |
31 | - } else { |
|
31 | + } |
|
32 | + else { |
|
32 | 33 | if ($warehouse->count != $count) { |
33 | 34 | $warehouse->count = $count; |
34 | 35 | $warehouse->save(); |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | $md5File = ''; |
40 | 40 | if ($file->md5) { |
41 | 41 | $md5File = $file->md5; |
42 | - } elseif (file_exists($file->getRealPath())) { |
|
42 | + } |
|
43 | + elseif (file_exists($file->getRealPath())) { |
|
43 | 44 | $md5File = $file->md5 = md5_file($file->getRealPath()); |
44 | 45 | $file->save(); |
45 | 46 | } |
@@ -60,7 +61,8 @@ discard block |
||
60 | 61 | $image->save(); |
61 | 62 | $ids[] = $image->id; |
62 | 63 | } |
63 | - } else { |
|
64 | + } |
|
65 | + else { |
|
64 | 66 | $image->weight = $key; |
65 | 67 | } |
66 | 68 | if ($image && !$this->model->image_file_id) { |
@@ -29,7 +29,8 @@ discard block |
||
29 | 29 | if (isset(Options::$options[$optionId]) && Options::$options[$optionId]->type == 'select') { |
30 | 30 | if (empty($options[$optionId])) { |
31 | 31 | $options[$optionId] = []; |
32 | - } else { |
|
32 | + } |
|
33 | + else { |
|
33 | 34 | if (!Options::$options[$optionId]->advance) { |
34 | 35 | Options::$options[$optionId]->advance = ['multi' => true]; |
35 | 36 | Options::$options[$optionId]->save(); |
@@ -38,7 +39,8 @@ discard block |
||
38 | 39 | if ($opt['Значение'] && isset(\App::$cur->migrations->ids['parseIds']['Ecommerce\Item\Option\Item'][$opt['Значение']])) { |
39 | 40 | $options[$optionId][] = \App::$cur->migrations->ids['parseIds']['Ecommerce\Item\Option\Item'][$opt['Значение']]->object_id; |
40 | 41 | } |
41 | - } else { |
|
42 | + } |
|
43 | + else { |
|
42 | 44 | $options[$optionId] = $opt['Значение']; |
43 | 45 | } |
44 | 46 | } |
@@ -50,13 +52,16 @@ discard block |
||
50 | 52 | if (isset(Options::$options[$itemParam->item_option_id]) && Options::$options[$itemParam->item_option_id]->type == 'select') { |
51 | 53 | if (empty($options[$itemParam->item_option_id]) || !in_array($itemParam->value, $options[$itemParam->item_option_id])) { |
52 | 54 | $itemParam->delete(); |
53 | - } else { |
|
55 | + } |
|
56 | + else { |
|
54 | 57 | unset($options[$itemParam->item_option_id][array_search($itemParam->value, $options[$itemParam->item_option_id])]); |
55 | 58 | } |
56 | - } else { |
|
59 | + } |
|
60 | + else { |
|
57 | 61 | if (empty($options[$itemParam->item_option_id])) { |
58 | 62 | $itemParam->delete(); |
59 | - } else { |
|
63 | + } |
|
64 | + else { |
|
60 | 65 | $itemParam->value = $options[$itemParam->item_option_id]; |
61 | 66 | $itemParam->save(); |
62 | 67 | unset($options[$itemParam->item_option_id]); |
@@ -73,7 +78,8 @@ discard block |
||
73 | 78 | ]); |
74 | 79 | $itemParam->save(); |
75 | 80 | } |
76 | - } else { |
|
81 | + } |
|
82 | + else { |
|
77 | 83 | $itemParam = new \Ecommerce\Item\Param([ |
78 | 84 | 'item_option_id' => $optionId, |
79 | 85 | 'item_id' => $this->model->id, |
@@ -156,7 +156,8 @@ |
||
156 | 156 | addToXml($xml, $req, 'Наименование', 'Метод оплаты'); |
157 | 157 | if ($cart->payType) { |
158 | 158 | addToXml($xml, $req, 'Значение', $cart->payType->name); |
159 | - } else { |
|
159 | + } |
|
160 | + else { |
|
160 | 161 | addToXml($xml, $req, 'Значение', 'Наличный расчет'); |
161 | 162 | } |
162 | 163 |
@@ -31,7 +31,8 @@ |
||
31 | 31 | } catch (\PDOException $exc) { |
32 | 32 | if ($exc->getCode() == '42S02') { |
33 | 33 | \Exchange1c\Exchange\File::createTable(); |
34 | - } elseif ($exc->getCode() == '42S22') { |
|
34 | + } |
|
35 | + elseif ($exc->getCode() == '42S22') { |
|
35 | 36 | $cols = \Exchange1c\Exchange\File::cols(); |
36 | 37 | foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) { |
37 | 38 | if (!isset($cols[\Exchange1c\Exchange\File::colPrefix() . $colName])) { |
@@ -31,7 +31,8 @@ |
||
31 | 31 | if (false === file_put_contents($dir . '/' . $filename, file_get_contents("php://input"))) { |
32 | 32 | $text = 'Fail on save file: ' . $filename; |
33 | 33 | $file->status = 'failure'; |
34 | - } else { |
|
34 | + } |
|
35 | + else { |
|
35 | 36 | $file->size = ceil(filesize($dir . '/' . $filename)); |
36 | 37 | $file->name = $filename; |
37 | 38 | $file->status = 'success'; |
@@ -18,19 +18,22 @@ |
||
18 | 18 | if (empty($callbacksData['text'])) { |
19 | 19 | $error = true; |
20 | 20 | Msg::add('Вы не написали текст отзыва'); |
21 | - } else { |
|
21 | + } |
|
22 | + else { |
|
22 | 23 | $callback->text = nl2br(htmlspecialchars($callbacksData['text'])); |
23 | 24 | } |
24 | 25 | if (empty($callbacksData['name'])) { |
25 | 26 | $error = true; |
26 | 27 | Msg::add('Вы не указали свое имя'); |
27 | - } else { |
|
28 | + } |
|
29 | + else { |
|
28 | 30 | $callback->name = htmlspecialchars($callbacksData['name']); |
29 | 31 | } |
30 | 32 | if (empty($callbacksData['phone'])) { |
31 | 33 | $error = true; |
32 | 34 | Msg::add('Вы не указали свой номер телефона'); |
33 | - } else { |
|
35 | + } |
|
36 | + else { |
|
34 | 37 | $callback->phone = htmlspecialchars($callbacksData['phone']); |
35 | 38 | } |
36 | 39 | $files = filter_var($_FILES['Callbacks'], FILTER_REQUIRE_ARRAY); |
@@ -69,9 +69,11 @@ discard block |
||
69 | 69 | public function resolveTemplate() { |
70 | 70 | if ($this->template !== 'inherit') { |
71 | 71 | return $this->template; |
72 | - } elseif ($this->template == 'inherit' && $this->category) { |
|
72 | + } |
|
73 | + elseif ($this->template == 'inherit' && $this->category) { |
|
73 | 74 | return $this->category->resolveTemplate(true); |
74 | - } else { |
|
75 | + } |
|
76 | + else { |
|
75 | 77 | return 'current'; |
76 | 78 | } |
77 | 79 | } |
@@ -79,9 +81,11 @@ discard block |
||
79 | 81 | public function resolveViewer() { |
80 | 82 | if ($this->viewer !== 'inherit') { |
81 | 83 | return $this->viewer; |
82 | - } elseif ($this->viewer == 'inherit' && $this->category) { |
|
84 | + } |
|
85 | + elseif ($this->viewer == 'inherit' && $this->category) { |
|
83 | 86 | return $this->category->resolveViewer(true); |
84 | - } else { |
|
87 | + } |
|
88 | + else { |
|
85 | 89 | return (!empty(App::$cur->ecommerce->config['defaultCategoryView']) ? App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList'); |
86 | 90 | } |
87 | 91 | } |