deploy: auto commit repo-root changes 2026-06-13 11:53:47
This commit is contained in:
@@ -892,9 +892,19 @@ class CommunityController extends BaseApiController
|
||||
|
||||
$result = AiService::analyzeLotteryPostImages($post->content ?: '', $images);
|
||||
if (empty($result['success']) || empty($result['content'])) {
|
||||
return [
|
||||
'success' => false,
|
||||
'error' => (string) ($result['error'] ?? '帖子图片分析失败'),
|
||||
$fallbackContent = $this->buildLiuheImageAnalysisFallback($images, (string) ($result['error'] ?? ''));
|
||||
if ($fallbackContent === '') {
|
||||
return [
|
||||
'success' => false,
|
||||
'error' => (string) ($result['error'] ?? '帖子图片分析失败'),
|
||||
];
|
||||
}
|
||||
|
||||
$result = [
|
||||
'success' => true,
|
||||
'content' => $fallbackContent,
|
||||
'tokens' => 0,
|
||||
'cost_ms' => (int) ($result['cost_ms'] ?? 0),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -912,6 +922,26 @@ class CommunityController extends BaseApiController
|
||||
return ['success' => true, 'ext' => $ext, 'from_cache' => false];
|
||||
}
|
||||
|
||||
private function buildLiuheImageAnalysisFallback(array $images, string $error): string
|
||||
{
|
||||
$error = trim($error);
|
||||
$isTimeout = $error !== '' && (stripos($error, 'timed out') !== false
|
||||
|| stripos($error, 'timeout') !== false
|
||||
|| stripos($error, 'cURL错误') !== false);
|
||||
if (!$isTimeout) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$lines = [
|
||||
'图片已下载并替换为站内链接,但视觉模型在限定时间内未返回完整识别结果。',
|
||||
'当前可确认信息:帖子包含 ' . count($images) . ' 张本地化图片,可在原帖图片区域查看。',
|
||||
'识别状态:图片文字、号码、生肖、波色等细项暂未可靠识别。',
|
||||
'处理建议:以下分析只能结合帖子文案和图片展示场景进行保守解读,不能视为开奖结果或中奖承诺。',
|
||||
];
|
||||
|
||||
return implode("\n", $lines);
|
||||
}
|
||||
|
||||
private static function buildVirtualAnalysisContent($post, bool $isLottery): string
|
||||
{
|
||||
if ($isLottery) {
|
||||
|
||||
Reference in New Issue
Block a user