Commit ec8256283443aac7e6c1600f30cb71ffe78396c9
1 parent
df73f762
temp commit
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
frontend/controllers/GoodsController.php
@@ -24,12 +24,16 @@ class GoodsController extends Controller { | @@ -24,12 +24,16 @@ class GoodsController extends Controller { | ||
24 | $brand = $arr_name[0]; | 24 | $brand = $arr_name[0]; |
25 | $article = $arr_name[1]; | 25 | $article = $arr_name[1]; |
26 | 26 | ||
27 | - | ||
28 | $arr = ['GoodsViewSearch' => ['name' => $article, | 27 | $arr = ['GoodsViewSearch' => ['name' => $article, |
29 | 'brand' => $brand]]; | 28 | 'brand' => $brand]]; |
29 | + if(empty( Yii::$app->user->identity )){ | ||
30 | + $margin_id = 1; | ||
31 | + }else{ | ||
32 | + $margin_id = Yii::$app->user->identity->margin_id; | ||
33 | + } | ||
30 | 34 | ||
31 | Yii::$app->session->setFlash('price_currency_id', 1); | 35 | Yii::$app->session->setFlash('price_currency_id', 1); |
32 | - Yii::$app->session->setFlash('price_margin_id', 1); | 36 | + Yii::$app->session->setFlash('price_margin_id', $margin_id); |
33 | 37 | ||
34 | $searchModel = new GoodsViewSearch(); | 38 | $searchModel = new GoodsViewSearch(); |
35 | $goods_provider = $searchModel->search($arr); | 39 | $goods_provider = $searchModel->search($arr); |