think-orm icon indicating copy to clipboard operation
think-orm copied to clipboard

可能是个bug belongsToMany 多对多 只能查出最后一条数据

Open ZhangGuangHuiCoder opened this issue 4 years ago • 0 comments

例如在group模型下定义好 关联 public function user(): \think\model\relation\BelongsToMany { return $this->belongsToMany(User::class, GroupAccess::class)->orderRaw('CONVERT(name USING gbk)'); }

self::with('user')->select(). 关联数据只有最后一条被查询到

ZhangGuangHuiCoder avatar Mar 30 '21 07:03 ZhangGuangHuiCoder