ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
这是错的 ~~~ $data=Db::table('tuan_order_4')->field('goods_id,count(goods_id) as goods_count,group_id')->group('goods_id')->order('goods_count','desc')->page(1,6)->select(); $data=Db::table('tuan_order_4')->field('goods_id,user_id,count(goods_id,user_id) as goods_count')->group('goods_id,user_id')->order('goods_count','desc')->page(1,6)->select(); ~~~ 这是对的 ~~~ $data=Db::table('tuan_order_4')->field('goods_id,count(goods_id) as goods_count')->group('goods_id')->order('goods_count','desc')->page(1,6)->select(); ~~~ field里面不能有额外的字段