Exemplo n.º 1
0
 /**
  * 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]);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAttachmentRels()
 {
     return $this->hasMany(AttachmentRel::className(), ['attach_id' => 'id']);
 }
Exemplo n.º 3
0
 /**
  * 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])]);
 }