/** * @return \yii\db\ActiveQuery */ public function getShopPriceGoods() { return $this->hasMany(ShopPriceGood::className(), ['shop_goods_id' => 'id']); }
public function getShopPriceGood() { return $this->hasOne(ShopPriceGood::className(), ['shop_goods_id' => 'id'])->via('shopGood')->groupBy(['shop_goods_id'])->orderBy(['price' => SORT_ASC]); }