示例#1
0
文件: User.php 项目: rocketyang/admap
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCities()
 {
     return $this->hasMany(City::className(), ['user_id' => 'id']);
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCity()
 {
     return $this->hasOne(City::className(), ['id' => 'city_id']);
 }