|
|
@@ -1,170 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-namespace App\Console\Commands;
|
|
|
-
|
|
|
-use App\Module\System\Models\AdminMenu;
|
|
|
-use Illuminate\Console\Command;
|
|
|
-
|
|
|
-class InsertFarmAdminMenu extends Command
|
|
|
-{
|
|
|
- /**
|
|
|
- * The name and signature of the console command.
|
|
|
- *
|
|
|
- * @var string
|
|
|
- */
|
|
|
- protected $signature = 'admin:insert-farm-menu';
|
|
|
-
|
|
|
- /**
|
|
|
- * The console command description.
|
|
|
- *
|
|
|
- * @var string
|
|
|
- */
|
|
|
- protected $description = '将农场模块的后台控制器插入到 AdminMenu 表中';
|
|
|
-
|
|
|
- /**
|
|
|
- * Execute the console command.
|
|
|
- *
|
|
|
- * @return int
|
|
|
- */
|
|
|
- public function handle()
|
|
|
- {
|
|
|
- // 获取最大的order值
|
|
|
- $maxOrder = AdminMenu::max('order');
|
|
|
- $nextOrder = $maxOrder + 1;
|
|
|
-
|
|
|
- // 1. 创建农场配置菜单(在游戏系统设置下)
|
|
|
- $farmConfigMenu = AdminMenu::firstOrCreate(
|
|
|
- ['title' => '🌱 农场配置', 'uri' => ''],
|
|
|
- [
|
|
|
- 'parent_id' => 259, // 游戏系统设置
|
|
|
- 'order' => $nextOrder++,
|
|
|
- 'icon' => 'fa-leaf',
|
|
|
- 'uri' => '',
|
|
|
- 'show' => 1
|
|
|
- ]
|
|
|
- );
|
|
|
-
|
|
|
- $this->info("创建农场配置菜单: {$farmConfigMenu->title}, ID: {$farmConfigMenu->id}");
|
|
|
-
|
|
|
- // 2. 创建农场管理菜单(在游戏运营管理下)
|
|
|
- $farmManageMenu = AdminMenu::firstOrCreate(
|
|
|
- ['title' => '🚜 农场管理', 'uri' => ''],
|
|
|
- [
|
|
|
- 'parent_id' => 260, // 游戏运营管理
|
|
|
- 'order' => $nextOrder++,
|
|
|
- 'icon' => 'fa-tractor',
|
|
|
- 'uri' => '',
|
|
|
- 'show' => 1
|
|
|
- ]
|
|
|
- );
|
|
|
-
|
|
|
- $this->info("创建农场管理菜单: {$farmManageMenu->title}, ID: {$farmManageMenu->id}");
|
|
|
-
|
|
|
- // 3. 添加农场配置子菜单
|
|
|
- $farmConfigSubMenus = [
|
|
|
- [
|
|
|
- 'title' => '🌾 种子配置管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-seeds',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🌱 种子产出配置',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-seed-outputs',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🏡 房屋等级配置',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-house-configs',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🌍 土地类型配置',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-land-types',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '📈 土地升级配置',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-land-upgrade-configs',
|
|
|
- ],
|
|
|
- ];
|
|
|
-
|
|
|
- foreach ($farmConfigSubMenus as $subMenu) {
|
|
|
- $menu = AdminMenu::firstOrCreate(
|
|
|
- ['title' => $subMenu['title'], 'uri' => $subMenu['uri']],
|
|
|
- [
|
|
|
- 'parent_id' => $farmConfigMenu->id,
|
|
|
- 'order' => $nextOrder++,
|
|
|
- 'icon' => $subMenu['icon'],
|
|
|
- 'uri' => $subMenu['uri'],
|
|
|
- 'show' => 1
|
|
|
- ]
|
|
|
- );
|
|
|
-
|
|
|
- $this->info("创建农场配置子菜单: {$menu->title}, URI: {$menu->uri}");
|
|
|
- }
|
|
|
-
|
|
|
- // 4. 添加农场管理子菜单
|
|
|
- $farmManageSubMenus = [
|
|
|
- [
|
|
|
- 'title' => '👨🌾 用户农场管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-users',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🌱 作物管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-crops',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🌍 土地管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-lands',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '✨ 神灵加持管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-buffs',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '🏆 达人等级管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-user-talents',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '👥 用户推荐关系',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-user-referrals',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '📝 收获记录管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-harvest-logs',
|
|
|
- ],
|
|
|
- [
|
|
|
- 'title' => '📊 升级记录管理',
|
|
|
- 'icon' => '',
|
|
|
- 'uri' => 'farm-upgrade-logs',
|
|
|
- ],
|
|
|
- ];
|
|
|
-
|
|
|
- foreach ($farmManageSubMenus as $subMenu) {
|
|
|
- $menu = AdminMenu::firstOrCreate(
|
|
|
- ['title' => $subMenu['title'], 'uri' => $subMenu['uri']],
|
|
|
- [
|
|
|
- 'parent_id' => $farmManageMenu->id,
|
|
|
- 'order' => $nextOrder++,
|
|
|
- 'icon' => $subMenu['icon'],
|
|
|
- 'uri' => $subMenu['uri'],
|
|
|
- 'show' => 1
|
|
|
- ]
|
|
|
- );
|
|
|
-
|
|
|
- $this->info("创建农场管理子菜单: {$menu->title}, URI: {$menu->uri}");
|
|
|
- }
|
|
|
-
|
|
|
- $this->info('农场模块菜单添加完成!');
|
|
|
-
|
|
|
- return 0;
|
|
|
- }
|
|
|
-}
|