| 123456789101112131415161718 |
- <?php
- namespace App\Console\Commands;
- use App\Services\Reporting\ReportSync;
- use Illuminate\Console\Command;
- class SyncReporting extends Command
- {
- protected $signature = 'reporting:sync {--full : 分批重新核对全部历史来源,不修改业务订单或钱包}';
- protected $description = '同步后台统一报表事实(默认增量,幂等,可重试)';
- public function handle(ReportSync $service): int
- {
- $result = $service->sync((bool) $this->option('full'));
- $this->line(json_encode($result, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR));
- return $result['errors'] > 0 ? self::FAILURE : self::SUCCESS;
- }
- }
|