User 与 UserProfile 我在User中加了一对一关联: public function profile()
{
return $this->hasOne('UserProfile', 'id', 'id')->field(
['id', 'gender', 'nickname', 'avatar', 'birthday', 'desc', 'remark']
);
}我要使用关联查询官方的例子:
User::with('profile')->select([1,2,3]);但是我需要加入条件查询:User::with('profile')->where(['create_time'=>18311225421])->select();这种就报错了:SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'create_time' in where clause is ambiguous问题:我写的方式不对,还是关联预载入就不支持条件查询? 