+ [task#152538] add the checkAIPromptUnique function.

This commit is contained in:
wangzemei
2025-12-02 16:32:20 +08:00
committed by sunhao
parent abfe867106
commit 4bacbc25d9
+17
View File
@@ -11347,6 +11347,23 @@ class upgradeModel extends model
return true;
}
/**
* 检查AI禅道智能体唯一性。
* Check AI zentao agent unique.
*
* @param object $aiPrompt
* @access public
* @return bool
*/
public function checkAIPromptUnique(object $aiPrompt): bool
{
$tableName = $this->config->db->prefix . 'ai_prompt';
$count = $this->dao->select('COUNT(1) AS count')->from("`$tableName`")
->where('name')->eq($aiPrompt->name)
->fetch('count');
return $count == 0;
}
/**
* 内置AI禅道智能体和相关字段。
* Initialize the AI prompts and fields.