/**
  * Lists all GoodsParamsName models.
  * @return mixed
  */
 public function actionIndex()
 {
     if (!isset($_GET['sort'])) {
         $_GET['sort'] = 'sort';
     }
     $searchModel = new GoodsParamsNameSearch();
     $params = Yii::$app->request->queryParams;
     $params['GoodsParamsNameSearch']['goods_type_type'] = $this->goodType;
     $dataProvider = $searchModel->search($params);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #2
0
 public function actionRefreshRender($val)
 {
     $arRes = [];
     $arVals = explode(';', $val);
     foreach ($arVals as $val) {
         $oVal = \app\models\GoodsParams::findOne($val);
         //            print ('<pre>');print_r($oVal);print('</pre>');
         //            $oPar = $oVal->getGoodsParamsName();
         $oPar = \app\models\GoodsParamsNameSearch::findOne($oVal->goods_params_name_id);
         //            print ('<pre>');print_r($oPar);print('</pre>');exit('100');
         $arRes[$oPar->id] = ['paramId' => $oPar->id, 'paramName' => $oPar->name, 'valId' => $oVal->id, 'valValue' => $oVal->value];
     }
     print json_encode(['res' => 'ok', 'items' => $arRes]);
 }