option('month') ?: ''); if ($month === '' && $this->option('auto')) { $month = $service->latestPendingMonth() ?? ''; if ($month === '') { $this->info('没有待抓取的发票月份。'); return self::SUCCESS; } } $result = $service->syncMonth( $month !== '' ? $month : now()->format('Y-m'), (int) $this->option('limit'), (bool) $this->option('force'), ); } catch (Throwable $exception) { report($exception); $this->error($exception->getMessage()); return self::FAILURE; } $this->info(json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); return self::SUCCESS; } }