Commit 27c5f6f5050752c70f3b3acd1286ab9309b0c6b3

Authored by Timur Kastemirov
2 parents da44d1f0 c89c8efd

Merge remote-tracking branch 'origin/master'

common/config/main.php
... ... @@ -9,7 +9,7 @@ return [
9 9 ],
10 10 'components' => [
11 11 'cache' => [
12   - 'class' => 'yii\caching\MemCache',
  12 + 'class' => 'yii\caching\DummyCache',
13 13 'keyPrefix' => 'linija_'
14 14 ],
15 15 'sms' => [
... ...
common/modules/product/models/Import.php
... ... @@ -106,7 +106,7 @@
106 106  
107 107 if ($from == 0) {
108 108 ProductStock::updateAll([ 'quantity' => 0 ]);
109   - ProductVariant::updateAll([ 'status' => 1 ]);
  109 + ProductVariant::updateAll([ 'status' => 1 ], 'status != 2');
110 110 }
111 111  
112 112 while (empty( $limit ) || $j++ < $limit) {
... ... @@ -164,7 +164,9 @@
164 164 // ===== Set stock ====
165 165 if (!$city_name) {
166 166 if (!$count) {
167   - $productVariant->status = 0;
  167 + if ($productVariant->status !== 2) {
  168 + $productVariant->status = 0;
  169 + }
168 170 if ($price_promo) {
169 171 $productVariant->price_old = $price;
170 172 $productVariant->price = $price_promo;
... ... @@ -227,7 +229,9 @@
227 229 }
228 230  
229 231 $productVariant->stock = $quantity;
230   - $productVariant->status = 0;
  232 + if ($productVariant->status !== 2) {
  233 + $productVariant->status = 0;
  234 + }
231 235 $productVariant->save();
232 236  
233 237 $this->output[] = '<font style="color:blue">Товар ' . $product_title . ' успешно сохранен</font>';
... ...
frontend/models/ProductFrontendSearch.php
... ... @@ -115,10 +115,13 @@
115 115 );
116 116  
117 117 // $query->groupBy(['product.product_id', 'product_variant.price', 'product_variant.stock']);
118   - $query->orderBy([
119   - 'brand.sort' => SORT_ASC,
120   - 'product_variant.stock' => SORT_DESC,
121   - ]);
  118 + $query->orderBy(
  119 + [
  120 + 'brand.sort' => SORT_ASC,
  121 + 'product_variant.price' => SORT_ASC,
  122 + 'product_variant.stock' => SORT_DESC,
  123 + ]
  124 + );
122 125 ProductHelper::_setQueryParams($query, $params);
123 126 if ($in_stock) {
124 127 $query->andWhere(
... ... @@ -143,7 +146,8 @@
143 146 ->innerJoin(
144 147 'event',
145 148 'event.event_id=events_to_products.event_id'
146   - )->where(['event.sale' => true]),
  149 + )
  150 + ->where([ 'event.sale' => true ]),
147 151 ],
148 152 ]
149 153 );
... ...
frontend/views/catalog/_product_item.php
... ... @@ -94,13 +94,15 @@ use yii\helpers\Url;
94 94 <div class="additional_info params">
95 95 <div class="block_title">Особенности
96 96 <span style="float: right;font-weight: normal;color: #390;font-size: 13px;">
97   - <?php if($model->variant->status == 1){?>
98   - снят с производства
99   - <?php } elseif($model->variant->stock > 0) {?>
100   - в наличии
101   - <?php } else {?>
102   - под заказ
103   - <?php } ?>
  97 + <?php if($model->variant->status == 1){?>
  98 + снят с производства
  99 + <?php } elseif($model->variant->status == 2) {?>
  100 + в ожидании
  101 + <?php } elseif($model->variant->stock > 0) {?>
  102 + в наличии
  103 + <?php } else {?>
  104 + под заказ
  105 + <?php } ?>
104 106 </span>
105 107 </div>
106 108 <div class="descr">
... ...
frontend/views/layouts/main.php
... ... @@ -474,6 +474,7 @@
474 474 </footer>
475 475  
476 476 <div class="btn-fixeds fixed-events"><a href="/event/main">акции</a></div>
  477 + <div class="btn-fixeds fixed-events btns_trio-link"><a href="/catalog/lyustry-i-potolochnoe-osveshchenie">Новинка<b></b></a></div>
477 478 <!--<div class="btn-fixeds fixed-sale"><a href="/event">Распродажа</a></div>-->
478 479  
479 480 <table border="0" cellspacing="0" cellpadding="0" class="reqsBox"></table>
... ...
frontend/web/css/css_header.css
... ... @@ -8255,6 +8255,26 @@ footer .content-title {
8255 8255 color: #01974a
8256 8256 }
8257 8257  
  8258 +.btn-fixeds.btns_trio-link {
  8259 + right: auto;
  8260 + left: 40px;
  8261 +}
  8262 +.btn-fixeds.btns_trio-link a {
  8263 + text-align: left;
  8264 + padding-left: 20px;
  8265 +}
  8266 +.btn-fixeds.btns_trio-link a b {
  8267 + background: url(../images/trio-min.png) 0 50% no-repeat;
  8268 + width: 32px;
  8269 + height: 41px;
  8270 + position: absolute;
  8271 + top: 0;
  8272 + right: 20px;
  8273 +}
  8274 +
  8275 +
  8276 +
  8277 +
8258 8278 .brbeadcrumbs-wr {
8259 8279 height: 83px;
8260 8280 line-height: 83px
... ... @@ -13250,7 +13270,17 @@ h1.title {
13250 13270 .fixed-events {
13251 13271 transform: rotate(-90deg);
13252 13272 -webkit-transform: rotate(-90deg);
13253   - right: -53px
  13273 + right: -53px;
  13274 + }
  13275 +
  13276 + .btn-fixeds.btns_trio-link {
  13277 + transform: rotate(90deg);
  13278 + -webkit-transform: rotate(90deg);
  13279 + left: -53px;
  13280 + }
  13281 + .btn-fixeds.btns_trio-link a{
  13282 + transform: rotate(180deg);
  13283 + -webkit-transform: rotate(180deg);
13254 13284 }
13255 13285  
13256 13286 .fixed-sale {
... ...
frontend/web/images/trio-min.png 0 → 100644

1.61 KB