求助一下,5.2获取到数组形式的数据?
使用这个进行数据查询的时候,获取的数据是数组和集合加在一块的,我如果加上toArray()的话,就会报错,我该怎么修改获取到一个数组的形式?
查询语句
获取的结果
查询语句
return DB::table('role_user as ru')
->join('access as a','ru.uid','=','a.role_id')
->groupBy('a.url')
->where('ru.uid','=',$uid)->get(['a.url']);
获取的结果
array:6 [
0 => {#183
+"url": "/CRM/Contract/index"
}
1 => {#187
+"url": "/CRM/Project/index"
}
2 => {#188
+"url": "/CRM/ProjectVisitLog/myVisit"
}
3 => {#189
+"url": "/CRM/userProject/index"
}
4 => {#190
+"url": "/CRM/WuyeCompany/index"
}
5 => {#191
+"url": "/CRM/WuyeContacter/index"
}
]
1 个回复
wenqingzzz
赞同来自: