SyncDrugReportAssCommand.php 1016 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Models\DrugReportInfo;
  4. use App\Servers\SyncDrugReportService;
  5. use Carbon\Carbon;
  6. use Illuminate\Console\Command;
  7. class SyncDrugReportAssCommand extends Command
  8. {
  9. protected $signature = 'sync-drug-report-ass';
  10. protected $description = '同步药检报告数据';
  11. public function __construct()
  12. {
  13. parent::__construct();
  14. }
  15. public function handle(SyncDrugReportService $service): int
  16. {
  17. echo "开始同步药检报告数据...", PHP_EOL;
  18. $isFull = true;
  19. $source = 'querydrugreportass';
  20. $startTime = '2025-12-01 00:00:00';
  21. $endTime = '2025-12-17 00:00:00';
  22. $page = 1;
  23. $pageSize = 20;
  24. $data = $service->syncDrugReport($source, $isFull, $startTime, $endTime, $page, $pageSize);
  25. echo $isFull ? "全量同步结束" : "增量同步结束", ",共{$data['count']},处理 {$data['total']} 条记录!", PHP_EOL;
  26. return 0;
  27. }
  28. }