foreach ($rule as $key=>$value) {
$data['role']['permissions'][$key] = [
'roleId' => $info['title'],
'permissionId' => $value['name'],
'permissionName' => $value['title'],
'actionList' => null,
'dataAccess' => null
];
foreach ($value['children'] as $k=>$v) {
$data['role']['permissions'][$key]['actionEntitySet'][$k] = [
'action' => $v['condition'],
'describe' => $v['title'],
'defaultCheck' => false
];
}
}
为什么父遍历得到的$data['role']['permissions'][$key]
是个对象,而子遍历得到的$data['role']['permissions'][$key]['actionEntitySet'][$k]
却是数组?
父遍历我想得到的是数组该怎么写才对?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…