info('开始刷新定时任务列表...'); $tasks = $taskService->getAllTasks(); $this->info(sprintf('成功刷新 %d 个定时任务', count($tasks))); // 显示任务列表 $this->table( ['任务名称', '描述', '执行频率', '状态'], array_map(fn($task) => [ $task['name'], $task['description'], $task['frequency'], $task['enabled'] ? '已启用' : '已禁用', ], $tasks) ); return Command::SUCCESS; } catch (\Exception $e) { $this->error("刷新失败: {$e->getMessage()}"); return Command::FAILURE; } } }