将心比心,方得人心~

thinkphp5关联模型Integrity constraint violation: 1052 Column 'id' in where clause is

周洲 2018-01-16 14:17:49

原因:两表的字段名冲突



$data = $this->where('id','in', $ids)->field('name,tel,img')->with('position')->select();


改为:



 
$data = $this->where('human_resources.id','in', $ids)->field('name,tel,img')->with('position')->select();


打赏

『微信打赏』

Tag标签关联模型 

我是有底线的