@@ -14,13 +14,13 @@ |
||
14 | 14 | \App::$cur->view->customAsset('js', '/static/moduleAsset/UserForms/js/formCatcher.js'); |
15 | 15 | if (!empty($_POST['UserForms'])) { |
16 | 16 | foreach ($_POST['UserForms'] as $form_id => $inputs) { |
17 | - $form = \UserForms\Form::get((int)$form_id); |
|
17 | + $form = \UserForms\Form::get((int) $form_id); |
|
18 | 18 | if (!$form) { |
19 | 19 | continue; |
20 | 20 | } |
21 | 21 | $formRecive = new \UserForms\Recive(); |
22 | - $formRecive->user_id = (int)\Users\User::$cur->id; |
|
23 | - $formRecive->form_id = (int)$form_id; |
|
22 | + $formRecive->user_id = (int) \Users\User::$cur->id; |
|
23 | + $formRecive->form_id = (int) $form_id; |
|
24 | 24 | $data = []; |
25 | 25 | $error = false; |
26 | 26 | foreach ($form->inputs as $input) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | static $name = 'PickPoint - курьерская служба'; |
17 | 17 | |
18 | 18 | /** |
19 | - * @param \Ecommerce\Cart $cart |
|
19 | + * @param string $URL |
|
20 | 20 | * @return \Money\Sums |
21 | 21 | */ |
22 | 22 | static function curl_get_file_contents($URL, $data) { |
@@ -35,8 +35,11 @@ |
||
35 | 35 | $contents = curl_exec($c); |
36 | 36 | curl_close($c); |
37 | 37 | |
38 | - if ($contents) return $contents; |
|
39 | - else return FALSE; |
|
38 | + if ($contents) { |
|
39 | + return $contents; |
|
40 | + } else { |
|
41 | + return FALSE; |
|
42 | + } |
|
40 | 43 | } |
41 | 44 | |
42 | 45 | static function calcPrice($cart) { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | curl_close($c); |
37 | 37 | |
38 | 38 | if ($contents) return $contents; |
39 | - else return FALSE; |
|
39 | + else return false; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | static function calcPrice($cart) { |
@@ -49,6 +49,6 @@ |
||
49 | 49 | ]; |
50 | 50 | $result = json_decode(file_get_contents($url . http_build_query($data)), true); |
51 | 51 | $sum = !empty($result['tariff'][0]['ground']['valnds']) ? $result['tariff'][0]['ground']['valnds'] : (!empty($result['tariff'][0]['avia']['valnds']) ? $result['tariff'][0]['avia']['valnds'] : 0); |
52 | - return new \Money\Sums([$cart->delivery->currency_id => $sum/100]); |
|
52 | + return new \Money\Sums([$cart->delivery->currency_id => $sum / 100]); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | public function activationAction($userId = 0, $hash = '') { |
115 | - $user = \Users\User::get((int)$userId); |
|
116 | - if (!$user || !$hash || $user->activation !== (string)$hash) { |
|
115 | + $user = \Users\User::get((int) $userId); |
|
116 | + if (!$user || !$hash || $user->activation !== (string) $hash) { |
|
117 | 117 | Tools::redirect('/', 'Во время активации произошли ошибки', 'danger'); |
118 | 118 | } |
119 | 119 | $user->activation = ''; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | public function resendActivationAction($userId = 0) { |
159 | - $user = \Users\User::get((int)$userId); |
|
159 | + $user = \Users\User::get((int) $userId); |
|
160 | 160 | if (!$user) { |
161 | 161 | Tools::redirect('/', 'Не указан пользователь', 'danger'); |
162 | 162 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | public function getPartnerInfoAction($userId = 0) { |
175 | - $userId = (int)$userId; |
|
175 | + $userId = (int) $userId; |
|
176 | 176 | $result = new \Server\Result(); |
177 | 177 | if (!$userId) { |
178 | 178 | $result->success = false; |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | public function changeWarehouse($count) { |
103 | 103 | $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]); |
104 | 104 | if ($warehouse) { |
105 | - $warehouse->count += (float)$count; |
|
105 | + $warehouse->count += (float) $count; |
|
106 | 106 | $warehouse->save(); |
107 | 107 | } else { |
108 | 108 | $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]); |
109 | 109 | if ($warehouse) { |
110 | - $warehouse->count += (float)$count; |
|
110 | + $warehouse->count += (float) $count; |
|
111 | 111 | $warehouse->save(); |
112 | 112 | } |
113 | 113 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` '; |
135 | 135 | \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
136 | 136 | if ($cart_id) { |
137 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int)$cart_id, '!='); |
|
137 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
138 | 138 | } |
139 | 139 | $on = ' |
140 | 140 | ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | |
148 | 148 | $blocked = \App::$cur->db->select(\Ecommerce\Warehouse\Block::table())->fetch(); |
149 | - return (float)$warehouse['sum'] - (float)$blocked['sum']; |
|
149 | + return (float) $warehouse['sum'] - (float) $blocked['sum']; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | public function beforeDelete() { |