info('开始清理过期推荐码...'); $showDebugInfo = $this->option('debug-info'); try { $count = ReferralCodeService::cleanExpiredReferralCodes(); if ($showDebugInfo) { $this->info("共清理了 {$count} 个过期推荐码"); } else { $this->info("清理完成"); } return 0; } catch (\Exception $e) { $this->error("清理过期推荐码失败: " . $e->getMessage()); if ($showDebugInfo) { $this->error($e->getTraceAsString()); } return 1; } } }