@@ -718,17 +718,21 @@ discard block |
||
| 718 | 718 | if (!$query) { |
| 719 | 719 | return []; |
| 720 | 720 | } |
| 721 | - if (!empty($options['where'])) |
|
| 722 | - $query->where($options['where']); |
|
| 721 | + if (!empty($options['where'])) { |
|
| 722 | + $query->where($options['where']); |
|
| 723 | + } |
|
| 723 | 724 | if (!empty($options['group'])) { |
| 724 | 725 | $query->group($options['group']); |
| 725 | 726 | } |
| 726 | - if (!empty($options['order'])) |
|
| 727 | - $query->order($options['order']); |
|
| 728 | - if (!empty($options['join'])) |
|
| 729 | - $query->join($options['join']); |
|
| 730 | - if (!empty($options['distinct'])) |
|
| 731 | - $query->distinct = $options['distinct']; |
|
| 727 | + if (!empty($options['order'])) { |
|
| 728 | + $query->order($options['order']); |
|
| 729 | + } |
|
| 730 | + if (!empty($options['join'])) { |
|
| 731 | + $query->join($options['join']); |
|
| 732 | + } |
|
| 733 | + if (!empty($options['distinct'])) { |
|
| 734 | + $query->distinct = $options['distinct']; |
|
| 735 | + } |
|
| 732 | 736 | |
| 733 | 737 | foreach (static::$relJoins as $join) { |
| 734 | 738 | $query->join($join[0], $join[1]); |
@@ -754,14 +758,14 @@ discard block |
||
| 754 | 758 | } |
| 755 | 759 | static::$needJoin = []; |
| 756 | 760 | |
| 757 | - if (!empty($options['limit'])) |
|
| 758 | - $limit = (int) $options['limit']; |
|
| 759 | - else { |
|
| 761 | + if (!empty($options['limit'])) { |
|
| 762 | + $limit = (int) $options['limit']; |
|
| 763 | + } else { |
|
| 760 | 764 | $limit = 0; |
| 761 | 765 | } |
| 762 | - if (!empty($options['start'])) |
|
| 763 | - $start = (int) $options['start']; |
|
| 764 | - else { |
|
| 766 | + if (!empty($options['start'])) { |
|
| 767 | + $start = (int) $options['start']; |
|
| 768 | + } else { |
|
| 765 | 769 | $start = 0; |
| 766 | 770 | } |
| 767 | 771 | if ($limit || $start) { |
@@ -1020,21 +1024,23 @@ discard block |
||
| 1020 | 1024 | if (!empty($options['where'])) { |
| 1021 | 1025 | static::fixPrefix($options['where'], 'first'); |
| 1022 | 1026 | } |
| 1023 | - if (!empty($options['where'])) |
|
| 1024 | - $query->where($options['where']); |
|
| 1025 | - if (!empty($options['join'])) |
|
| 1026 | - $query->join($options['join']); |
|
| 1027 | + if (!empty($options['where'])) { |
|
| 1028 | + $query->where($options['where']); |
|
| 1029 | + } |
|
| 1030 | + if (!empty($options['join'])) { |
|
| 1031 | + $query->join($options['join']); |
|
| 1032 | + } |
|
| 1027 | 1033 | if (!empty($options['order'])) { |
| 1028 | 1034 | $query->order($options['order']); |
| 1029 | 1035 | } |
| 1030 | - if (!empty($options['limit'])) |
|
| 1031 | - $limit = (int) $options['limit']; |
|
| 1032 | - else { |
|
| 1036 | + if (!empty($options['limit'])) { |
|
| 1037 | + $limit = (int) $options['limit']; |
|
| 1038 | + } else { |
|
| 1033 | 1039 | $limit = 0; |
| 1034 | 1040 | } |
| 1035 | - if (!empty($options['start'])) |
|
| 1036 | - $start = (int) $options['start']; |
|
| 1037 | - else { |
|
| 1041 | + if (!empty($options['start'])) { |
|
| 1042 | + $start = (int) $options['start']; |
|
| 1043 | + } else { |
|
| 1038 | 1044 | $start = 0; |
| 1039 | 1045 | } |
| 1040 | 1046 | if ($limit || $start) { |
@@ -1112,8 +1118,9 @@ discard block |
||
| 1112 | 1118 | |
| 1113 | 1119 | $values = []; |
| 1114 | 1120 | foreach ($cols as $col => $param) { |
| 1115 | - if (isset($params[$col])) |
|
| 1116 | - $values[$col] = $params[$col]; |
|
| 1121 | + if (isset($params[$col])) { |
|
| 1122 | + $values[$col] = $params[$col]; |
|
| 1123 | + } |
|
| 1117 | 1124 | } |
| 1118 | 1125 | if (empty($values)) { |
| 1119 | 1126 | return false; |
@@ -1296,8 +1303,9 @@ discard block |
||
| 1296 | 1303 | $values = []; |
| 1297 | 1304 | |
| 1298 | 1305 | foreach ($this->cols() as $col => $param) { |
| 1299 | - if (isset($this->_params[$col])) |
|
| 1300 | - $values[$col] = $this->_params[$col]; |
|
| 1306 | + if (isset($this->_params[$col])) { |
|
| 1307 | + $values[$col] = $this->_params[$col]; |
|
| 1308 | + } |
|
| 1301 | 1309 | } |
| 1302 | 1310 | if (empty($values) && empty($options['empty'])) { |
| 1303 | 1311 | return false; |
@@ -1457,8 +1465,9 @@ discard block |
||
| 1457 | 1465 | { |
| 1458 | 1466 | |
| 1459 | 1467 | foreach (static::relations() as $relName => $rel) { |
| 1460 | - if ($rel['col'] == $col) |
|
| 1461 | - return $relName; |
|
| 1468 | + if ($rel['col'] == $col) { |
|
| 1469 | + return $relName; |
|
| 1470 | + } |
|
| 1462 | 1471 | } |
| 1463 | 1472 | return NULL; |
| 1464 | 1473 | } |
@@ -61,21 +61,21 @@ |
||
| 61 | 61 | if ($first) { |
| 62 | 62 | $first = false; |
| 63 | 63 | } else { |
| 64 | - $string.= '<br />'; |
|
| 64 | + $string .= '<br />'; |
|
| 65 | 65 | } |
| 66 | - $string.= '<span style="white-space:nowrap;">'; |
|
| 67 | - $string.= number_format($sum, 2, '.', ' '); |
|
| 66 | + $string .= '<span style="white-space:nowrap;">'; |
|
| 67 | + $string .= number_format($sum, 2, '.', ' '); |
|
| 68 | 68 | if (\App::$cur->money) { |
| 69 | 69 | $currency = \Money\Currency::get($currency_id); |
| 70 | 70 | if ($currency) { |
| 71 | - $string.= ' ' . $currency->acronym(); |
|
| 71 | + $string .= ' ' . $currency->acronym(); |
|
| 72 | 72 | } else { |
| 73 | - $string.= ' руб.'; |
|
| 73 | + $string .= ' руб.'; |
|
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | - $string.= ' руб.'; |
|
| 76 | + $string .= ' руб.'; |
|
| 77 | 77 | } |
| 78 | - $string.= '</span>'; |
|
| 78 | + $string .= '</span>'; |
|
| 79 | 79 | } |
| 80 | 80 | return $string; |
| 81 | 81 | } |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | $groups[$stage->group] = $stage; |
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | - $discounts = Cart\Discount::getList(['where'=>['cart_id',$this->id]]); |
|
| 285 | + $discounts = Cart\Discount::getList(['where'=>['cart_id', $this->id]]); |
|
| 286 | 286 | foreach ($discounts as $discount) { |
| 287 | 287 | if (!isset($groups[$discount->group]) && $discount->auto) { |
| 288 | 288 | $discount->delete(); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | 'manager' => [ |
| 44 | 44 | 'map' => [ |
| 45 | 45 | ['name', 'code'], |
| 46 | - ['delivery', 'electronic','discount'] |
|
| 46 | + ['delivery', 'electronic', 'discount'] |
|
| 47 | 47 | ] |
| 48 | 48 | ] |
| 49 | 49 | ]; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | if ($cart->delivery) {
|
| 28 | 28 | echo "<h4>Информация о доставке</h4>"; |
| 29 | 29 | if ($cart->delivery->price_text || $cart->delivery->price) {
|
| 30 | - echo "<div>Стоимость доставки: <b>" . ($cart->delivery->price_text ? $cart->delivery->price_text : ( $cart->delivery->price . ' ' . ($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.') )) . '</b></div>'; |
|
| 30 | + echo "<div>Стоимость доставки: <b>" . ($cart->delivery->price_text ? $cart->delivery->price_text : ($cart->delivery->price . ' ' . ($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.'))) . '</b></div>'; |
|
| 31 | 31 | } |
| 32 | 32 | if ((float) $cart->delivery->max_cart_price) {
|
| 33 | 33 | echo '<div>При заказе товаров на сумму от ' . $cart->delivery->max_cart_price . ' руб - бесплатно</div>'; |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | $form->input($field->type, "deliveryFields[{$field->id}]", $field->name, ['required' => $field->required]);
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | - } |
|
| 43 | - else {
|
|
| 42 | + } else {
|
|
| 44 | 43 | echo "<h4>Выберите способ доставки</h4>"; |
| 45 | 44 | } |
| 46 | 45 | ?> |