+ [task#152538] add the checkAIPromptUnique function.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user