原因:两表的字段名冲突
$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();
将心比心,方得人心~
周洲 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标签: 关联模型
上一篇: PHP下载远程文件 到本地
下一篇: php判断一个数组里有没有重复的值