Browse Source

菜单按钮

cqpCow 1 year ago
parent
commit
9c2af70e30
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/Service/EmployeeService.php

+ 5 - 1
app/Service/EmployeeService.php

@@ -806,7 +806,11 @@ class EmployeeService extends Service
             ->get()->toArray();
         $button_map = [];
         foreach ($button as $value){
-            if(! in_array($value['button_id'], $button_map[$value['menu_id']])) $button_map[$value['menu_id']][] = $value['button_id'];
+            if(! isset($button_map[$value['menu_id']])){
+                $button_map[$value['menu_id']][] = $value['button_id'];
+            }else{
+                if(! in_array($value['button_id'], $button_map[$value['menu_id']])) $button_map[$value['menu_id']][] = $value['button_id'];
+            }
         }
 
         return $button_map;