where('permission_code', 'draw.reopen.manage')->exists()) { return 0; } $menuId = (int) DB::table('admin_menus')->where('code', 'draw.results')->value('id'); $actionId = DB::table('admin_action_catalog')->where('code', 'manage')->value('id'); if ($menuId === 0 || $actionId === null) { return 0; } $now = Carbon::now(); DB::table('admin_menu_actions')->insert([ 'menu_id' => $menuId, 'action_id' => (int) $actionId, 'permission_code' => 'draw.reopen.manage', 'name' => '期号重开', 'status' => 1, 'created_at' => $now, 'updated_at' => $now, ]); return 1; } }