/** * Displays a single Goods model. * @param integer $id * @return mixed */ public function actionView($id) { $list = AttachmentRel::getByRes('share', $id); return $this->render('view', ['model' => $this->findModel($id), 'imgs' => $list]); }
/** * @return \yii\db\ActiveQuery */ public function getAttachmentRels() { return $this->hasMany(AttachmentRel::className(), ['attach_id' => 'id']); }
/** * Displays a single Goods model. * @param integer $id * @return mixed */ public function actionView($id) { $av = AvRel::getGoodsRel($id); $model = $this->findModel($id); return $this->render('view', ['model' => $model, 'av' => $av, 'imgs' => AttachmentRel::getByRes('shop_goods', $id, 'small', [$model->cover])]); }