Commit d25c776313db3373b3ed80af95b548daf3ae5dfe
1 parent
a58f01f1
add crocc search in goods view
Showing
3 changed files
with
7 additions
and
5 deletions
Show diff stats
common/models/GoodsView.php
| ... | ... | @@ -30,8 +30,7 @@ class GoodsView extends \backend\components\base\BaseActiveRecord |
| 30 | 30 | /** |
| 31 | 31 | * @inheritdoc |
| 32 | 32 | */ |
| 33 | - public $price_currency_id; | |
| 34 | - public $price_margin_id; | |
| 33 | + | |
| 35 | 34 | |
| 36 | 35 | public static function tableName() |
| 37 | 36 | { |
| ... | ... | @@ -77,7 +76,10 @@ class GoodsView extends \backend\components\base\BaseActiveRecord |
| 77 | 76 | return round($this->price * ($this->rate/$rate) * $koef, 2); |
| 78 | 77 | } |
| 79 | 78 | |
| 80 | - | |
| 79 | + public static function primaryKey() | |
| 80 | + { | |
| 81 | + return ['name','brand']; | |
| 82 | + } | |
| 81 | 83 | |
| 82 | 84 | |
| 83 | 85 | public function attributeLabels() | ... | ... |
common/models/GoodsViewSearch.php
frontend/controllers/GoodsController.php
| ... | ... | @@ -26,7 +26,7 @@ class GoodsController extends Controller { |
| 26 | 26 | Yii::$app->session->setFlash('price_margin_id', 1); |
| 27 | 27 | |
| 28 | 28 | $searchModel = new GoodsViewSearch(); |
| 29 | - $goods_provider = $searchModel->search($arr); | |
| 29 | + $goods_provider = $searchModel->searchCrosses($arr); | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | //$cross_arr = DetailsCrosses::find()->select('ARTICLE, BRAND')->where(['CROSS_ARTICLE' => '0092S40090', 'CROSS_BRAND' => 'BOSCH'])->asArray()->all(); | ... | ... |