$ry
->alias('ry')
->join('school sch','ry.fazhengdw = sch.id')
->join('leixing lx','ry.leixingid = lx.id')
->field('ry.id,ry.mingcheng,ry.fazhengsj,ry.status,ry.fazhengdw as fazhengdw,sch.jiancheng as schmingcheng,lx.mingcheng as lxmingcheng')
->with('school.jibie')
->withCount('info') //提示这行错误
->select();错误提示:SQLSTATE[42S22]: Column not found: 1054 Unknown column 'jkp_rongyu.id' in 'where clause'Call Stack: in Connection.php line 388
at Connection->query('SELECT `ry`.`id`,`ry...', [], false, false) in Query.php line 227
at Query->query('SELECT `ry`.`id`,`ry...', [], false, false) in Query.php line 2342
at Query->select() in Rongyu.php line 124
at Rongyu->test()
at ReflectionMethod->invokeArgs(object(Rongyu), []) in App.php line 343
at App::invokeMethod([object(Rongyu), 'test'], []) in App.php line 595
at App::module(['admin', 'rongyu', 'test'], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...], true) in App.php line 456
at App::exec(['type' => 'module', 'module' => ['admin', 'rongyu', 'test']], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...]) in App.php line 139
at App::run() in start.php line 19
at require('C:\xampp\htdocs\jiao...') in index.php line 17我知道是因为设置别名后,字段名不对,但是这个问题怎么解决? 最佳答案