コード例 #1
0
 public function actionAddress()
 {
     $id = Yii::$app->user->identity->id;
     $billing = BillingAddress::find()->where(['user_id' => $id])->all();
     $delivery = DeliveryAddress::find()->where(['user_id' => $id])->all();
     return $this->render('address', ['billing' => $billing, 'delivery' => $delivery]);
 }
コード例 #2
0
ファイル: User.php プロジェクト: frankpaul142/chaide
 public function getBillingAddresses()
 {
     return $this->hasMany(BillingAddress::className(), ['user_id' => 'id']);
 }