Completed
Push — master ( ac9176...10d1ae )
by Alexey
05:15
created
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 'col' => 'item_offer_id',
77 77
                 //'resultKey' => 'code',
78 78
                 'resultKey' => 'item_offer_option_id',
79
-                'join' => [Offer\Option::table(), Offer\Option::index() . ' = ' . Offer\Param::colPrefix() . Offer\Option::index()]
79
+                'join' => [Offer\Option::table(), Offer\Option::index().' = '.Offer\Param::colPrefix().Offer\Option::index()]
80 80
             ],
81 81
             'item' => [
82 82
                 'model' => 'Ecommerce\Item',
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
     {
90 90
         $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]);
91 91
         if ($warehouse) {
92
-            $warehouse->count +=(float) $count;
92
+            $warehouse->count += (float) $count;
93 93
             $warehouse->save();
94 94
         } else {
95 95
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
96 96
             if ($warehouse) {
97
-                $warehouse->count +=(float) $count;
97
+                $warehouse->count += (float) $count;
98 98
                 $warehouse->save();
99 99
             }
100 100
         }
@@ -112,21 +112,21 @@  discard block
 block discarded – undo
112 112
             }
113 113
         }
114 114
         if ($warehouseIds) {
115
-            \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index(), $warehouseIds, 'IN');
115
+            \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index(), $warehouseIds, 'IN');
116 116
         }
117
-        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
118
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` ';
117
+        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
118
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` ';
119 119
         $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch();
120 120
 
121
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` ';
122
-        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
121
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` ';
122
+        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
123 123
         if ($cart_id) {
124
-            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!=');
124
+            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!=');
125 125
         }
126 126
         $on = '
127
-            ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND (
128
-            (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || 
129
-            (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
127
+            ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND (
128
+            (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || 
129
+            (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
130 130
             )
131 131
         ';
132 132
         \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner');
Please login to merge, or discard this patch.
system/modules/Ui/Controllers/UiController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,25 +38,25 @@
 block discarded – undo
38 38
             $return = new Server\Result();
39 39
             ob_start();
40 40
             $form->checkRequest($params, true);
41
-            $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : '');
41
+            $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : '');
42 42
             $get = $_GET;
43 43
             if (isset($get['notSave'])) {
44 44
                 unset($get['notSave']);
45 45
             }
46
-            $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get);
46
+            $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get);
47 47
             $form->draw($params, true);
48 48
             $return->content = ob_get_contents();
49 49
             ob_end_clean();
50 50
             $return->send();
51 51
         } else {
52 52
             $form->checkRequest($params);
53
-            $_GET['item'] = get_class($form->model) . ($model->pk() ? ':' . $model->pk() : '');
53
+            $_GET['item'] = get_class($form->model).($model->pk() ? ':'.$model->pk() : '');
54 54
             $get = $_GET;
55 55
             if (isset($get['notSave'])) {
56 56
                 unset($get['notSave']);
57 57
             }
58
-            $form->action = (App::$cur->system ? '/' . App::$cur->name : '') . '/ui/formPopUp/?' . http_build_query($get);
59
-            $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ') . $form->header);
58
+            $form->action = (App::$cur->system ? '/'.App::$cur->name : '').'/ui/formPopUp/?'.http_build_query($get);
59
+            $this->view->setTitle(($model && $model->pk() ? 'Изменить ' : 'Создать ').$form->header);
60 60
             $this->view->page(['content' => 'form', 'data' => compact('form', 'params')]);
61 61
         }
62 62
     }
Please login to merge, or discard this patch.
system/modules/Money/snippets/rewardType/currency.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     'procent' => 'Процент',
22 22
     'amount' => 'Сумма',
23 23
 ];
24
-return $levelTypes[$level->params['type']->value] . ': ' . $level->params['amount']->value . ' ' . ($level->params['type']->value == 'procent' ? '%' : ($level->params['currency_id']->value ? \Money\Currency::get($level->params['currency_id']->value)->acronym() : ''));
24
+return $levelTypes[$level->params['type']->value].': '.$level->params['amount']->value.' '.($level->params['type']->value == 'procent' ? '%' : ($level->params['currency_id']->value ? \Money\Currency::get($level->params['currency_id']->value)->acronym() : ''));
25 25
 },
26 26
     'rewarder' => function($reward, $sums, $user, $rootUser, $level, $rewardGet) {
27 27
 $wallets = \App::$cur->money->getUserWallets($user->id);
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
         return 0;
64 64
     }
65 65
 
66
-    $text = 'Вознаграждение по программе "' . $reward->name . '"';
66
+    $text = 'Вознаграждение по программе "'.$reward->name.'"';
67 67
     if ($rootUser->id != $user->id) {
68
-        $text .= ' от ' . $rootUser->name();
68
+        $text .= ' от '.$rootUser->name();
69 69
     }
70 70
 
71 71
     if (!$rewardGet && $reward->block) {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $block->wallet_id = $wallets[$level->params['currency_id']->value]->id;
74 74
         $block->amount = $amount;
75 75
         $block->comment = $text;
76
-        $block->data = 'reward:' . $reward->id;
76
+        $block->data = 'reward:'.$reward->id;
77 77
         $dateGenerators = \App::$cur->money->getSnippets('expiredDateGenerator');
78 78
         if ($reward->block_date_expired && !empty($dateGenerators[$reward->block_date_expired])) {
79 79
             $date = $dateGenerators[$reward->block_date_expired]($reward, $user);
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     } else {
89 89
         $wallets[$level->params['currency_id']->value]->diff($amount, $text);
90 90
     }
91
-    \App::$cur->users->AddUserActivity($user->id, 4, $text . '<br />' . $amount . ' ' . $wallets[$level->params['currency_id']->value]->currency->acronym());
91
+    \App::$cur->users->AddUserActivity($user->id, 4, $text.'<br />'.$amount.' '.$wallets[$level->params['currency_id']->value]->currency->acronym());
92 92
 }
93 93
 return $amount;
94 94
 }
Please login to merge, or discard this patch.
system/modules/Ui/objects/ActiveForm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 $this->formName = $form;
49 49
                 $this->form = \App::$cur->ui->getModelForm($this->modelName, $form);
50 50
                 if (empty($this->form)) {
51
-                    throw new \Exception('empty form ' . $form);
51
+                    throw new \Exception('empty form '.$form);
52 52
                 }
53 53
                 $this->inputs = $this->getInputs();
54 54
             }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                             $this->model->_params[$modelName::index()] = 0;
85 85
                         }
86 86
                         $relOptions['model']::fixPrefix($relOptions['col']);
87
-                        $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]);
87
+                        $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]);
88 88
                     }
89 89
                     $inputs[$col]->parent = $this;
90 90
                 } elseif (!empty($modelName::$cols[$col])) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function checkRequest($params = [], $ajax = false)
99 99
     {
100 100
         if (!$this->checkAccess()) {
101
-            $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->formName . '"');
101
+            $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->formName.'"');
102 102
             return [];
103 103
         }
104 104
         $successId = 0;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                     if (!empty($this->form['userGroupReadonly'][\Users\User::$cur->group_id]) && in_array($col, $this->form['userGroupReadonly'][\Users\User::$cur->group_id])) {
123 123
                         continue;
124 124
                     }
125
-                    $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($param['type']);
125
+                    $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($param['type']);
126 126
                     $input = new $inputClassName();
127 127
                     $input->activeForm = $this;
128 128
                     $input->activeFormParams = $params;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                     if ($ajax) {
168 168
                         \Msg::show();
169 169
                     } elseif (!empty($_GET['redirectUrl'])) {
170
-                        \Tools::redirect($_GET['redirectUrl'] . (!empty($_GET['dataManagerHash']) ? '#' . $_GET['dataManagerHash'] : ''));
170
+                        \Tools::redirect($_GET['redirectUrl'].(!empty($_GET['dataManagerHash']) ? '#'.$_GET['dataManagerHash'] : ''));
171 171
                     }
172 172
                     $successId = $this->model->pk();
173 173
                 }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     public function draw($params = [], $ajax = false)
183 183
     {
184 184
         if (!$this->checkAccess()) {
185
-            $this->drawError('you not have access to "' . $this->modelName . '" form with name: "' . $this->formName . '"');
185
+            $this->drawError('you not have access to "'.$this->modelName.'" form with name: "'.$this->formName.'"');
186 186
             return [];
187 187
         }
188 188
         $form = new Form(!empty($this->form['formOptions']) ? $this->form['formOptions'] : []);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         if (is_object($options)) {
195 195
             $options->draw();
196 196
         } else {
197
-            $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($options['type']);
197
+            $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($options['type']);
198 198
             $input = new $inputClassName();
199 199
             $input->form = $form;
200 200
             $input->activeForm = $this;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         }
272 272
         foreach ($values as $key => $value) {
273 273
             if (is_array($value) && !empty($value['input']) && empty($value['input']['noprefix'])) {
274
-                $values[$key]['input']['name'] = $aditionalInputNamePrefix . "[{$value['input']['name']}]";
274
+                $values[$key]['input']['name'] = $aditionalInputNamePrefix."[{$value['input']['name']}]";
275 275
             }
276 276
         }
277 277
         return $values;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
     public function checkAccess()
296 296
     {
297 297
         if (empty($this->form)) {
298
-            $this->drawError('"' . $this->modelName . '" form with name: "' . $this->formName . '" not found');
298
+            $this->drawError('"'.$this->modelName.'" form with name: "'.$this->formName.'" not found');
299 299
             return false;
300 300
         }
301 301
         if (\App::$cur->Access && !\App::$cur->Access->checkAccess($this)) {
Please login to merge, or discard this patch.