用户权限分类

$all_action = $this->db->getAll("SELECT action_list,id,parent_id FROM shop_user_action");
foreach ($all_action as $v){
if($v['parent_id'] > 0){
$child_action[$v['parent_id']][] = $v['action_list'];
}else{
$parent_action[] = $v;
}
}
foreach ($parent_action as $p){
$all_action_list[$p['action_list']] = $child_action[$p['id']];
}


你可能感兴趣的:(用户权限分类)