用laravel 框架想实现一个分页接口,返回数据表中其中一部分字段
$list = DB::table('booklist_table')- orderBy('create_time','asc')-...paginate($size,['id','title','author','image'])- toJson();
return json_decode($list,true);
结果运行报错
"...line 1 (SQL: select count(`id`, `title`, `author`, `image`) as aggregate from `booklist_table`) ◀"
后来经过查询原因将代码改为...')- select('id','title','author','image')- orderBy('create_time','asc')- paginate($size)- toJson();
结果正确...以上这篇laravel 解决paginate查询多个字段报错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考。