| 1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- class ReportTeacherWeeklyPdfCommand extends Command
- {
- protected $signature = 'report:teacher-weekly-pdf';
- protected $description = '生成老师组卷与学情分析周报 PDF(文件名带日期与时间戳 teacher-weekly-stats-Y-m-d_His.pdf)';
- public function handle(): int
- {
- $script = base_path('scripts/report_teacher_weekly_stats_pdf.php');
- if (! is_file($script)) {
- $this->error('找不到脚本:'.$script);
- return self::FAILURE;
- }
- passthru(escapeshellarg(PHP_BINARY).' '.escapeshellarg($script), $code);
- return $code === 0 ? self::SUCCESS : self::FAILURE;
- }
- }
|