完善expert领域
This commit is contained in:
@@ -102,6 +102,7 @@ class UserFieldAiService
|
||||
throw new Exception('LLM returned empty field');
|
||||
}
|
||||
$this->updateFieldAi($userId, $fieldAi, self::STATUS_DONE, '');
|
||||
$this->syncLinkedExperts($userId);
|
||||
return ['ok' => true, 'field_ai' => $fieldAi];
|
||||
} catch (\Throwable $e) {
|
||||
$this->updateFieldAi($userId, '', self::STATUS_FAILED, mb_substr($e->getMessage(), 0, 500));
|
||||
@@ -460,4 +461,17 @@ class UserFieldAiService
|
||||
$line = date('Y-m-d H:i:s') . ' ' . $msg . PHP_EOL;
|
||||
@file_put_contents($this->logFile, $line, FILE_APPEND);
|
||||
}
|
||||
|
||||
/**
|
||||
* user.field_ai 更新后,同步到同邮箱 expert(方案 C 关联)。
|
||||
*/
|
||||
private function syncLinkedExperts($userId)
|
||||
{
|
||||
try {
|
||||
$svc = new ExpertFieldAiService();
|
||||
$svc->syncExpertsByUserId(intval($userId), true);
|
||||
} catch (\Throwable $e) {
|
||||
$this->log('[FieldAi] sync expert fail user_id=' . $userId . ' ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user