Completed
Push — master ( 6b7664...8cf912 )
by Alexey
05:42
created
system/modules/Ecommerce/models/Cart/Item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
                     $event->save();
32 32
                 }
33 33
                 if ($cur->count != $this->count) {
34
-                    $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 4, 'info' => $this->item_offer_price_id . "|" . ($this->count - $cur->count)]);
34
+                    $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 4, 'info' => $this->item_offer_price_id."|".($this->count - $cur->count)]);
35 35
                     $event->save();
36 36
                 }
37 37
             }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Cart.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
     public static function itemName($item)
218 218
     {
219
-        return $item->pk() . '. ' . $item->name();
219
+        return $item->pk().'. '.$item->name();
220 220
     }
221 221
 
222 222
     public static $forms = [
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                 $groups[$stage->group] = $stage;
282 282
             }
283 283
         }
284
-        $discounts = Cart\Discount::getList(['where'=>['cart_id',$this->id]]);
284
+        $discounts = Cart\Discount::getList(['where'=>['cart_id', $this->id]]);
285 285
         foreach ($discounts as $discount) {
286 286
             if (!isset($groups[$discount->group]) && $discount->auto) {
287 287
                 $discount->delete();
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]);
80 80
         if ($warehouse) {
81
-            $warehouse->count +=(float) $count;
81
+            $warehouse->count += (float) $count;
82 82
             $warehouse->save();
83 83
         } else {
84 84
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
85 85
             if ($warehouse) {
86
-                $warehouse->count +=(float) $count;
86
+                $warehouse->count += (float) $count;
87 87
                 $warehouse->save();
88 88
             }
89 89
         }
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 
92 92
     public function warehouseCount($cart_id = 0)
93 93
     {
94
-        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
95
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` ';
94
+        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
95
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` ';
96 96
         $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch();
97 97
 
98
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` ';
99
-        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
98
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` ';
99
+        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
100 100
         if ($cart_id) {
101
-            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!=');
101
+            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!=');
102 102
         }
103 103
         $on = '
104
-            ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND (
105
-            (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || 
106
-            (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
104
+            ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND (
105
+            (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || 
106
+            (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
107 107
             )
108 108
         ';
109 109
         \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner');
Please login to merge, or discard this patch.
system/modules/Ecommerce/appAdminControllers/content/configure.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
   foreach ($managers as $manager) {
8 8
       $dataManager = new Ui\DataManager($manager);
9 9
       $dataManagers[$manager] = $dataManager;
10
-      $code = 'tab_' . str_replace('\\', '_', $manager);
10
+      $code = 'tab_'.str_replace('\\', '_', $manager);
11 11
       echo "<li role='presentation'><a href='#{$code}' aria-controls='{$code}' role='tab' data-toggle='tab'>{$dataManager->name}</a></li>";
12 12
   }
13 13
   ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
   </div>
55 55
   <?php
56 56
   foreach ($dataManagers as $manager => $dataManager) {
57
-      $code = 'tab_' . str_replace('\\', '_', $manager);
57
+      $code = 'tab_'.str_replace('\\', '_', $manager);
58 58
       ?>
59 59
       <div role="tabpanel" class="tab-pane fade" id="<?= $code; ?>">
60 60
         <?php
Please login to merge, or discard this patch.
system/modules/Ecommerce/appAdminControllers/EcommerceController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@
 block discarded – undo
74 74
                 unset($items[$key]);
75 75
                 unset($item);
76 76
             }
77
-            echo 'Происходит процесс индексации: проиндексировано ' . $i * $count;
78
-            Tools::redirect('/admin/ecommerce/reSearchIndex/' . $i);
77
+            echo 'Происходит процесс индексации: проиндексировано '.$i * $count;
78
+            Tools::redirect('/admin/ecommerce/reSearchIndex/'.$i);
79 79
         }
80 80
     }
81 81
 
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/CartController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                         $warecount = $cartitem->price->offer->warehouseCount($cart->id);
63 63
                         if ($cartitem->count > $warecount) {
64 64
                             $error = true;
65
-                            Msg::add('Вы заказали <b>' . $cartitem->item->name . '</b> больше чем есть на складе. на складе: <b>' . $warecount . '</b>', 'danger');
65
+                            Msg::add('Вы заказали <b>'.$cartitem->item->name.'</b> больше чем есть на складе. на складе: <b>'.$warecount.'</b>', 'danger');
66 66
                         }
67 67
                     }
68 68
                 }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                     foreach ($deliverys[$cart->delivery_id]->fields as $field) {
75 75
                         if (empty($_POST['deliveryFields'][$field->id]) && $field->required) {
76 76
                             $error = 1;
77
-                            Msg::add('Вы не указали: ' . $field->name);
77
+                            Msg::add('Вы не указали: '.$field->name);
78 78
                         }
79 79
                     }
80 80
                 }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 foreach (\Ecommerce\UserAdds\Field::getList() as $field) {
91 91
                     if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
92 92
                         $error = 1;
93
-                        Msg::add('Вы не указали: ' . $field->name);
93
+                        Msg::add('Вы не указали: '.$field->name);
94 94
                     }
95 95
                 }
96 96
                 if (!empty($_POST['discounts']['card_item_id'])) {
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
                     }
128 128
                     $cart = \Ecommerce\Cart::get($cart->id);
129 129
                     if (!empty(\App::$cur->ecommerce->config['notify_mail'])) {
130
-                        $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/ecommerce/Cart">Админ панель</a>';
131
-                        $title = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
132
-                        \Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
130
+                        $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/admin/ecommerce/Cart">Админ панель</a>';
131
+                        $title = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
132
+                        \Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
133 133
                     }
134 134
                     if ($this->notifications) {
135 135
                         $notification = new Notifications\Notification();
136
-                        $notification->name = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
136
+                        $notification->name = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
137 137
                         $notification->text = 'Перейдите в админ панель чтобы просмотреть новый заказ';
138 138
                         $notification->chanel_id = $this->notifications->getChanel('Ecommerce-orders')->id;
139 139
                         $notification->save();
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             'href' => '/ecommerce/cart'
180 180
         ];
181 181
         $bread[] = [
182
-            'text' => 'Заказ: №' . $cart->id,
183
-            'href' => '/ecommerce/cart/orderDetail/' . $cart->id
182
+            'text' => 'Заказ: №'.$cart->id,
183
+            'href' => '/ecommerce/cart/orderDetail/'.$cart->id
184 184
         ];
185
-        $this->view->setTitle('Заказ №' . $cart->id);
185
+        $this->view->setTitle('Заказ №'.$cart->id);
186 186
         $this->view->page(['data' => compact('cart', 'bread')]);
187 187
     }
188 188
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
             $result->send();
276 276
         }
277 277
 
278
-        $item->sales ++;
278
+        $item->sales++;
279 279
         $item->save();
280 280
 
281 281
         if (empty($_GET['count']))
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
         if (empty($this->module->config['sell_over_warehouse']) && $price->offer->warehouseCount() < $count) {
290 290
             $result->success = false;
291
-            $result->content = 'На складе недостаточно товара! Доступно: ' . $price->offer->warehouseCount();
291
+            $result->content = 'На складе недостаточно товара! Доступно: '.$price->offer->warehouseCount();
292 292
             $result->send();
293 293
         }
294 294
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             $cart->addItem($price->id, $count);
306 306
         }
307 307
         $cart->calc();
308
-        $result->successMsg = '<a href="/ecommerce/view/' . $item->id . '">' . $item->name() . ($price->offer->name() ? ' (' . $price->offer->name() . ')' : '') . '</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
308
+        $result->successMsg = '<a href="/ecommerce/view/'.$item->id.'">'.$item->name().($price->offer->name() ? ' ('.$price->offer->name().')' : '').'</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
309 309
         $result->send();
310 310
     }
311 311
 
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/Cart/orderDetail.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
       <td class="text-left" style="width: 50%;">              
17 17
         <?php
18 18
         foreach ($orderDeatilCols as $col => $label) {
19
-            echo "<b>{$label}</b> " . $cart->$col . "<br>";
19
+            echo "<b>{$label}</b> ".$cart->$col."<br>";
20 20
         }
21 21
         ?>
22 22
       </td>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         <?php
40 40
         if ($cart->infos) {
41 41
             foreach ($cart->infos as $info) {
42
-                echo "<b>{$info->field->name()}</b> " . $info->value . "<br>";
42
+                echo "<b>{$info->field->name()}</b> ".$info->value."<br>";
43 43
             }
44 44
         }
45 45
         ?>
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
               if (App::$cur->money) {
124 124
                   $currency = Money\Currency::get($currency_id);
125 125
                   if ($currency) {
126
-                      echo '&nbsp;' . $currency->acronym();
126
+                      echo '&nbsp;'.$currency->acronym();
127 127
                   } else {
128 128
                       echo '&nbsp;руб.';
129 129
                   }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
               if (App::$cur->money) {
167 167
                   $currency = Money\Currency::get($currency_id);
168 168
                   if ($currency) {
169
-                      echo '&nbsp;' . $currency->acronym();
169
+                      echo '&nbsp;'.$currency->acronym();
170 170
                   } else {
171 171
                       echo '&nbsp;руб.';
172 172
                   }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                 case'2':
206 206
                     $price = Ecommerce\Item\Offer\Price::get($status->info);
207 207
                     if ($price) {
208
-                        echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a>";
208
+                        echo "<a href = '/ecommerce/view/{$item->id}'>".$price->offer->item->name()."</a>";
209 209
                     } else {
210 210
                         echo 'Товар удален';
211 211
                     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                     $info = explode('|', $status->info);
215 215
                     $price = Ecommerce\Item\Offer\Price::get($info[0]);
216 216
                     if ($price) {
217
-                        echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a> " . ($info[1] > 0 ? '+' . $info[1] : $info[1]);
217
+                        echo "<a href = '/ecommerce/view/{$item->id}'>".$price->offer->item->name()."</a> ".($info[1] > 0 ? '+'.$info[1] : $info[1]);
218 218
                     } else {
219 219
                         echo 'Товар удален';
220 220
                     }
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/Cart/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
                               </a>
102 102
                             </td>
103 103
                             <td class="text-left name">
104
-                              <a href="/ecommerce/view/<?= $cartItem->item->id; ?>"><?= $cartItem->item->name() . ($cartItem->price->offer->name && $cartItem->price->offer->name != $cartItem->item->name() ? ' (' . $cartItem->price->offer->name . ')' : ''); ?></a>
104
+                              <a href="/ecommerce/view/<?= $cartItem->item->id; ?>"><?= $cartItem->item->name().($cartItem->price->offer->name && $cartItem->price->offer->name != $cartItem->item->name() ? ' ('.$cartItem->price->offer->name.')' : ''); ?></a>
105 105
                             </td>
106 106
                             <td class="text-left quantity">
107 107
                               <?php $this->widget('Ecommerce\cart/ranger', compact('form', 'cart', 'cartItem')); ?>
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/filters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
           switch ($option->type) {
23 23
               case 'radio':
24 24
                   foreach ($option->items as $item) {
25
-                      $this->widget('Ui\Form/' . $option->type, [
25
+                      $this->widget('Ui\Form/'.$option->type, [
26 26
                           'label' => $item->name,
27 27
                           'name' => "filters[options][{$option->id}]",
28 28
                           !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false,
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                   }
46 46
                   break;
47 47
               default:
48
-                  $this->widget('Ui\Form/' . $option->type, [
48
+                  $this->widget('Ui\Form/'.$option->type, [
49 49
                       'label' => $option->name,
50 50
                       'name' => "filters[options][{$option->id}]",
51 51
                       'options' => [
Please login to merge, or discard this patch.