* add get role templates method.

This commit is contained in:
Chenjianyu
2023-08-01 11:08:10 +08:00
parent 97c11cb6f4
commit a9cf9b60a4
2 changed files with 14 additions and 0 deletions
+1
View File
@@ -271,6 +271,7 @@ class ai extends control
$this->view->promptID = $promptID;
$this->view->lastActiveStep = $this->ai->getLastActiveStep($prompt);
$this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name {$this->lang->colon} " . $this->lang->ai->prompts->assignRole . " {$this->lang->colon} " . $this->lang->ai->prompts->common;
$this->view->roleTemplates = $this->ai->getRoleTemplates();
$this->display();
}
+13
View File
@@ -1134,4 +1134,17 @@ class aiModel extends model
$_SESSION['aiInjectData'][$targetForm->m][$targetForm->f] = is_string($data) ? $data : json_encode($data);
}
/**
* Get role templates from db.
*
* @access public
* @return array
*/
public function getRoleTemplates()
{
return $this->dao->select('*')->from(TABLE_PROMPTROLE)
->where('deleted')->eq(0)
->fetchAll();
}
}