public function getDoctor()
{
return $this->hasOne(Doctor::className(), ['id' => 'doctor_id']);
}
比如我在model中关联了一张doctor表,但是我想给doctor表设置别名,请问要怎么设置?
Try This :
标题
model 连表查询时怎么给字段设置别名?
public function getDoctor()
{
return $this->hasOne(Doctor::className(), ['id' => 'doctor_id']);
}
比如我在model中关联了一张doctor表,但是我想给doctor表设置别名,请问要怎么设置?
Try This :
标题
model 连表查询时怎么给字段设置别名?