这个错误是在将整个源代码迁移到5.3版本后出现的,我现在已经抓狂了两个多小时.
所以我有一种Eloquent 的疑问:
POI::select('*', DB::raw("SQRT( POW((x - {$this->x}),2) + POW((y - {$this->y}),2) ) AS distance"))
->where('status', Config::get('app.poi_state.enabled'))
->whereNotIn('id', $excludePOIList)
->having('distance', '<=', $distance)
->orderBy('distance')->get();
它在升级前工作过,现在抛出:
语法错误或访问冲突:1463非分组字段"距离"
我想判断我的服务器上是否启用了唯一的_FULL _GROUP _BY模式,但它不是...
Select @sql\u模式
同样的查询在MySQL workbench中运行良好.