setName('testcommand') ->setDescription('the testcommand command'); } protected function execute(Input $input, Output $output) { // 指令输出 $output->writeln('开始测试自动排课任务(包含今天)...'); try { $obj = new CourseScheduleJob(); $result = $obj->doJob(); if ($result) { $output->writeln('✅ 自动排课任务执行成功!'); } else { $output->writeln('❌ 自动排课任务执行失败!'); } } catch (\Exception $e) { $output->writeln('❌ 执行异常:' . $e->getMessage()); } $output->writeln('testcommand'); } }