option('period-end')); if ($periodEnd === '') { $this->error('缺少 --period-end。'); return self::FAILURE; } try { $result = $importer->import((string) $this->argument('path'), $periodEnd); } catch (InvalidArgumentException|RuntimeException $exception) { $this->error($exception->getMessage()); return self::FAILURE; } catch (Throwable $exception) { report($exception); $this->error('拼多多平台期末余额导入失败,详细原因已记录到受保护日志。'); return self::FAILURE; } $this->table(['截止日期', '店铺数', '余额合计', '替换旧行数', '来源文件'], [[ $result['period_end'], $result['total'], $result['balance_total'], $result['replaced'], $result['source_filename'], ]]); return self::SUCCESS; } }