@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | public function submitReviewAction() { |
| 14 | 14 | $result = new \Server\Result(); |
| 15 | 15 | if (!empty($_POST['review']['item_id']) && !empty($_POST['review']['name']) && !empty($_POST['review']['text'])) { |
| 16 | - $item = Ecommerce\Item::get((int)$_POST['review']['item_id']); |
|
| 16 | + $item = Ecommerce\Item::get((int) $_POST['review']['item_id']); |
|
| 17 | 17 | if (!$item) { |
| 18 | 18 | $result->success = false; |
| 19 | 19 | $result->content = ['errorText' => 'Товар не найден']; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'item_id' => $item->id, |
| 24 | 24 | 'user_id' => \Users\User::$cur->id, |
| 25 | 25 | 'name' => htmlspecialchars($_POST['review']['name']), |
| 26 | - 'rating' => (int)$_POST['review']['rating'], |
|
| 26 | + 'rating' => (int) $_POST['review']['rating'], |
|
| 27 | 27 | 'text' => htmlspecialchars($_POST['review']['text']), |
| 28 | 28 | 'mail' => !empty($_POST['review']['email']) ? htmlspecialchars($_POST['review']['email']) : '', |
| 29 | 29 | 'file_id' => !empty($_FILES['review']['tmp_name']['file']) ? App::$cur->files->upload([ |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $user = Users\User::$cur; |
| 48 | 48 | if (!empty($_POST) && !empty($_POST['card_id'])) { |
| 49 | 49 | $error = false; |
| 50 | - $card = \Ecommerce\Card::get((int)$_POST['card_id']); |
|
| 50 | + $card = \Ecommerce\Card::get((int) $_POST['card_id']); |
|
| 51 | 51 | if (!$card) { |
| 52 | 52 | $error = true; |
| 53 | 53 | Msg::add('Такой карты не существует', 'danger'); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | //search |
| 134 | 134 | if (!empty($_GET['search'])) { |
| 135 | 135 | if (!empty($_GET['inCatalog'])) { |
| 136 | - $category_id = (int)$_GET['inCatalog']; |
|
| 136 | + $category_id = (int) $_GET['inCatalog']; |
|
| 137 | 137 | } |
| 138 | 138 | $search = $_GET['search']; |
| 139 | 139 | } else { |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } else { |
| 167 | 167 | $category_id = 0; |
| 168 | 168 | } |
| 169 | - if($category){ |
|
| 169 | + if ($category) { |
|
| 170 | 170 | $category->views++; |
| 171 | 171 | $category->save(); |
| 172 | 172 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | public function viewAction($id = '', $quick = 0) { |
| 282 | - $item = \Ecommerce\Item::get((int)$id); |
|
| 282 | + $item = \Ecommerce\Item::get((int) $id); |
|
| 283 | 283 | if (!$item) { |
| 284 | 284 | Tools::redirect('/ecommerce/', 'Такой товар не найден'); |
| 285 | 285 | } |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | |
| 328 | 328 | public function toggleFavAction($itemId) { |
| 329 | 329 | $result = new Server\Result(); |
| 330 | - $item = \Ecommerce\Item::get((int)$itemId); |
|
| 330 | + $item = \Ecommerce\Item::get((int) $itemId); |
|
| 331 | 331 | if (!$item) { |
| 332 | 332 | $result->success = false; |
| 333 | 333 | $result->content = 'Товар не найден'; |
@@ -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 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` '; |
| 134 | 134 | \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id); |
| 135 | 135 | if ($cart_id) { |
| 136 | - \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int)$cart_id, '!='); |
|
| 136 | + \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!='); |
|
| 137 | 137 | } |
| 138 | 138 | $on = ' |
| 139 | 139 | ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND ( |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner'); |
| 145 | 145 | |
| 146 | 146 | $blocked = \App::$cur->db->select(\Ecommerce\Warehouse\Block::table())->fetch(); |
| 147 | - return (float)$warehouse['sum'] - (float)$blocked['sum']; |
|
| 147 | + return (float) $warehouse['sum'] - (float) $blocked['sum']; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | public function beforeDelete() { |