/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ItemProp::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['prop_id' => $this->prop_id, 'category_id' => $this->category_id, 'parent_prop_id' => $this->parent_prop_id, 'parent_value_id' => $this->parent_value_id, 'type' => $this->type, 'is_key_prop' => $this->is_key_prop, 'is_sale_prop' => $this->is_sale_prop, 'is_color_prop' => $this->is_color_prop, 'must' => $this->must, 'multi' => $this->multi, 'status' => $this->status, 'sort_order' => $this->sort_order]); $query->andFilterWhere(['like', 'prop_name', $this->prop_name])->andFilterWhere(['like', 'prop_alias', $this->prop_alias]); return $dataProvider; }
} ?> "> <table class="description_table type_2 m_bottom_15"> <!-- Price Starts --> <!-- <div class="deal_price">--> <!-- <span class="cor_gray">市场价:<strong>--><?php //echo $itemModel->price ?> <!--</strong>元</span>--> <!-- </div>--> <?php $itemProps = $propValues = array(); $itemPropModels = \star\catalog\models\ItemProp::find()->where(['category_id' => $itemModel->category_id])->all(); foreach ($itemPropModels as $itemProp) { $itemProps[$itemProp->prop_id] = $itemProp; foreach ($itemProp->propValues as $propValue) { $propValues[$propValue->value_id] = $propValue; } } $pvids = json_decode($itemModel->props); foreach ($pvids as $pid => $pvid) { if (isset($itemProps[$pid]) && $itemProps[$pid]->is_sale_prop) { $itemProp = $itemProps[$pid]; ?> <tr><td class="v_align_m"><?php echo $itemProp->prop_name; ?> :</td>