コード例 #1
0
 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]);
 }
コード例 #2
0
 public function getAddress()
 {
     return $this->hasOne(UserAddress::className(), ['id' => 'addressId']);
 }