public function actionUseraddresslist() { $userId = trim(Yii::$app->request->get('id')); if (!isset($userId) || empty($userId)) { $this->redirect(Variable::$home_url); exit; } $userAddress = new UserAddress(); $list = $userAddress->findAll(['userId' => $userId]); return $this->render(Variable::$userAddress_view, ['model' => $list]); }
public function getAddress() { return $this->hasOne(UserAddress::className(), ['id' => 'addressId']); }