This commit is contained in:
Your Name
2026-10-09 09:36:17 +08:00
parent 88b94c2fc6
commit 51d8fd409e
727 changed files with 3753398 additions and 102 deletions
@@ -11,6 +11,7 @@ use app\common\model\tcm\Diagnosis;
use app\common\model\tcm\DiagnosisAiReport;
use app\common\service\DifyChatService;
use app\common\service\NihaixiaClinicalSkill;
use app\common\service\TcmAncientBooksReference;
use think\facade\Db;
use think\facade\Log;
@@ -1630,7 +1631,7 @@ PROMPT;
'model_label' => self::cleanText($modelLabel, 50),
'report_content' => $content,
'message_id' => self::cleanText($messageId, 191),
'ancient_book_sources_json' => json_encode($ancientBookSources, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '[]',
'ancient_book_sources_json' => json_encode(TcmAncientBooksReference::localizeSources($ancientBookSources), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?: '[]',
'prompt_version' => self::PROMPT_VERSION,
'case_fingerprint' => (string) $context['fingerprint'],
'generated_by' => $adminId,
@@ -1763,7 +1764,8 @@ PROMPT;
private static function decodeAncientBookSources(mixed $value): array
{
$decoded = is_string($value) ? json_decode($value, true) : null;
return is_array($decoded) && array_is_list($decoded) ? array_values(array_filter($decoded, 'is_array')) : [];
return is_array($decoded) && array_is_list($decoded)
? TcmAncientBooksReference::localizeSources($decoded) : [];
}
/** @return array<string,array<string,mixed>> */