diff --git a/common/models/GoodsView.php b/common/models/GoodsView.php index 878d4ae..9bab210 100644 --- a/common/models/GoodsView.php +++ b/common/models/GoodsView.php @@ -30,8 +30,7 @@ class GoodsView extends \backend\components\base\BaseActiveRecord /** * @inheritdoc */ - public $price_currency_id; - public $price_margin_id; + public static function tableName() { @@ -77,7 +76,10 @@ class GoodsView extends \backend\components\base\BaseActiveRecord return round($this->price * ($this->rate/$rate) * $koef, 2); } - + public static function primaryKey() + { + return ['name','brand']; + } public function attributeLabels() diff --git a/common/models/GoodsViewSearch.php b/common/models/GoodsViewSearch.php index 5f475e1..08489cc 100644 --- a/common/models/GoodsViewSearch.php +++ b/common/models/GoodsViewSearch.php @@ -18,7 +18,7 @@ class GoodsViewSearch extends GoodsView public function rules() { return [ - [['name', 'brand', 'price_currency_id', 'price_margin_id'], 'safe'], + [['name', 'brand'], 'safe'], ]; } diff --git a/frontend/controllers/GoodsController.php b/frontend/controllers/GoodsController.php index fc9eddd..43b0f8b 100644 --- a/frontend/controllers/GoodsController.php +++ b/frontend/controllers/GoodsController.php @@ -26,7 +26,7 @@ class GoodsController extends Controller { Yii::$app->session->setFlash('price_margin_id', 1); $searchModel = new GoodsViewSearch(); - $goods_provider = $searchModel->search($arr); + $goods_provider = $searchModel->searchCrosses($arr); //$cross_arr = DetailsCrosses::find()->select('ARTICLE, BRAND')->where(['CROSS_ARTICLE' => '0092S40090', 'CROSS_BRAND' => 'BOSCH'])->asArray()->all(); -- libgit2 0.21.4