查询的所有数据然后再按某个字段再分组

浏览:916 发布日期:2018/11/07 分类:求助交流 关键字: 分组
Thinkphp中有没有类似java中List.stream().collect(Collectors.groupingBy(TeamRing::getCode))这样的分组方法
把 array(
(1,"张三","小学");
(2,"张三2","小学");
(3,"张三3","中学");

变成
array(
"小学"=>array(
(1,"张三","小学");
(2,"张三2","小学");
)
"中学"=>array(
(3,"张三3","中学");
)
最佳答案
评论( 相关
后面还有条评论,点击查看>>