@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Merchant currency |
|
| 4 | - * |
|
| 5 | - * @author Alexey Krupskiy <[email protected]> |
|
| 6 | - * @link http://inji.ru/ |
|
| 7 | - * @copyright 2015 Alexey Krupskiy |
|
| 8 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | - */ |
|
| 3 | + * Merchant currency |
|
| 4 | + * |
|
| 5 | + * @author Alexey Krupskiy <[email protected]> |
|
| 6 | + * @link http://inji.ru/ |
|
| 7 | + * @copyright 2015 Alexey Krupskiy |
|
| 8 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
| 9 | + */ |
|
| 10 | 10 | namespace Money\Merchant; |
| 11 | 11 | |
| 12 | 12 | class Currency extends \Model |
@@ -48,16 +48,16 @@ |
||
| 48 | 48 | ], |
| 49 | 49 | 'name' => 'Переводы', |
| 50 | 50 | 'cols' => [ |
| 51 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
| 51 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
| 52 | 52 | ], |
| 53 | 53 | 'actions' => [ |
| 54 | 54 | 'Money\CancelTransfer', 'Money\CompleteTransfer' |
| 55 | 55 | ], |
| 56 | 56 | 'sortable' => [ |
| 57 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
| 57 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
| 58 | 58 | ], |
| 59 | 59 | 'filters' => [ |
| 60 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
| 60 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
| 61 | 61 | ] |
| 62 | 62 | ] |
| 63 | 63 | ]; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if (empty($blocks[$block->wallet->currency_id])) { |
| 103 | 103 | $blocks[$block->wallet->currency_id] = $block->amount; |
| 104 | 104 | } else { |
| 105 | - $blocks[$block->wallet->currency_id]+= $block->amount; |
|
| 105 | + $blocks[$block->wallet->currency_id] += $block->amount; |
|
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | return $blocks; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $rootUser = $rootUser ? $rootUser : \Users\User::$cur; |
| 169 | 169 | $reward = \Money\Reward::get($reward_id); |
| 170 | 170 | $reward->checkBlocked(); |
| 171 | - $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id]]); |
|
| 171 | + $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]); |
|
| 172 | 172 | if ($reward_count >= $reward->quantity && $reward->quantity) |
| 173 | 173 | return false; |
| 174 | 174 | $types = $this->getSnippets('rewardType'); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]); |
| 190 | 190 | $amount = 0; |
| 191 | 191 | foreach ($recives as $recive) { |
| 192 | - $amount+=$recive->amount; |
|
| 192 | + $amount += $recive->amount; |
|
| 193 | 193 | } |
| 194 | 194 | if ($amount >= $reward->peruser) { |
| 195 | 195 | continue; |
@@ -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 | ]; |
@@ -2,24 +2,24 @@ |
||
| 2 | 2 | <div class="col-md-4"> |
| 3 | 3 | <ul class="nav nav-pills nav-stacked"> |
| 4 | 4 | <?php |
| 5 | - $hiddenId = Tools::randomString(); |
|
| 6 | - foreach ($payTypes as $payType) { |
|
| 7 | - if ((!empty($_POST['payType']) && $_POST['payType'] == $payType->id) || ($cart->payType && $payType->id == $cart->payType->id)) { |
|
| 8 | - $checked = 'checked'; |
|
| 9 | - } else { |
|
| 10 | - $checked = ''; |
|
| 11 | - } |
|
| 12 | - echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $payType->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | - echo $payType->name; |
|
| 14 | - echo '</a></li>'; |
|
| 15 | - } |
|
| 16 | - $form->input('hidden', "payType", '', [ |
|
| 17 | - 'value' => $cart->paytype_id, |
|
| 18 | - 'attributes' => [ |
|
| 19 | - 'id' => $hiddenId |
|
| 20 | - ], |
|
| 21 | - ]); |
|
| 22 | - ?> |
|
| 5 | + $hiddenId = Tools::randomString(); |
|
| 6 | + foreach ($payTypes as $payType) { |
|
| 7 | + if ((!empty($_POST['payType']) && $_POST['payType'] == $payType->id) || ($cart->payType && $payType->id == $cart->payType->id)) { |
|
| 8 | + $checked = 'checked'; |
|
| 9 | + } else { |
|
| 10 | + $checked = ''; |
|
| 11 | + } |
|
| 12 | + echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $payType->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | + echo $payType->name; |
|
| 14 | + echo '</a></li>'; |
|
| 15 | + } |
|
| 16 | + $form->input('hidden', "payType", '', [ |
|
| 17 | + 'value' => $cart->paytype_id, |
|
| 18 | + 'attributes' => [ |
|
| 19 | + 'id' => $hiddenId |
|
| 20 | + ], |
|
| 21 | + ]); |
|
| 22 | + ?> |
|
| 23 | 23 | </ul> |
| 24 | 24 | </div> |
| 25 | 25 | <div class="col-md-8"> |
@@ -2,24 +2,24 @@ |
||
| 2 | 2 | <div class="col-md-4"> |
| 3 | 3 | <ul class="nav nav-pills nav-stacked"> |
| 4 | 4 | <?php |
| 5 | - $hiddenId = Tools::randomString(); |
|
| 6 | - foreach ($deliverys as $delivery) {
|
|
| 7 | - if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) {
|
|
| 8 | - $checked = 'checked'; |
|
| 9 | - } else {
|
|
| 10 | - $checked = ''; |
|
| 11 | - } |
|
| 12 | - echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | - echo $delivery->name; |
|
| 14 | - echo '</a></li>'; |
|
| 15 | - } |
|
| 16 | - $form->input('hidden', "delivery", '', [
|
|
| 17 | - 'value' => $cart->delivery_id, |
|
| 18 | - 'attributes' => [ |
|
| 19 | - 'id' => $hiddenId |
|
| 20 | - ], |
|
| 21 | - ]); |
|
| 22 | - ?> |
|
| 5 | + $hiddenId = Tools::randomString(); |
|
| 6 | + foreach ($deliverys as $delivery) {
|
|
| 7 | + if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) {
|
|
| 8 | + $checked = 'checked'; |
|
| 9 | + } else {
|
|
| 10 | + $checked = ''; |
|
| 11 | + } |
|
| 12 | + echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
| 13 | + echo $delivery->name; |
|
| 14 | + echo '</a></li>'; |
|
| 15 | + } |
|
| 16 | + $form->input('hidden', "delivery", '', [
|
|
| 17 | + 'value' => $cart->delivery_id, |
|
| 18 | + 'attributes' => [ |
|
| 19 | + 'id' => $hiddenId |
|
| 20 | + ], |
|
| 21 | + ]); |
|
| 22 | + ?> |
|
| 23 | 23 | </ul> |
| 24 | 24 | </div> |
| 25 | 25 | <div class="col-md-8"> |
@@ -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 | ?> |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | } else { |
| 65 | 65 | $parserName = '\Migrations\Parser\Object\\' . ucfirst($param->type); |
| 66 | 66 | } |
| 67 | - if (!in_array($parserName, ['\Migrations\Parser\Object\ObjectLink','Exchange1c\Parser\Item\Images', '\Migrations\Parser\Object\Value', '\Migrations\Parser\Object\Relation', '\Migrations\Parser\Object\ParamsList'])) { |
|
| 67 | + if (!in_array($parserName, ['\Migrations\Parser\Object\ObjectLink', 'Exchange1c\Parser\Item\Images', '\Migrations\Parser\Object\Value', '\Migrations\Parser\Object\Relation', '\Migrations\Parser\Object\ParamsList'])) { |
|
| 68 | 68 | var_dump($parserName); |
| 69 | 69 | exit(); |
| 70 | 70 | } |