示例#1
0
文件: Vote.php 项目: bariew/sitown
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAnswer()
 {
     return $this->hasOne(Answer::className(), ['id' => 'answer_id'])->from(['answer' => Answer::tableName()]);
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAnswers()
 {
     return $this->hasMany(Answer::className(), ['question_id' => 'id']);
 }