* tweak uniqueness error message.

This commit is contained in:
liwenrui
2023-07-17 15:51:15 +08:00
parent 1dcbc64fe2
commit 220874cd7b
5 changed files with 18 additions and 8 deletions
+3 -2
View File
@@ -21,8 +21,9 @@ $lang->ai->nextStep = 'Next';
$lang->ai->goTesting = 'Go testing';
$lang->ai->validate = new stdclass();
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
$lang->ai->prompts = new stdclass();
$lang->ai->prompts->common = 'Prompt';
+3 -2
View File
@@ -21,8 +21,9 @@ $lang->ai->nextStep = 'Next';
$lang->ai->goTesting = 'Go testing';
$lang->ai->validate = new stdclass();
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
$lang->ai->prompts = new stdclass();
$lang->ai->prompts->common = 'Prompt';
+3 -2
View File
@@ -21,8 +21,9 @@ $lang->ai->nextStep = 'Next';
$lang->ai->goTesting = 'Go testing';
$lang->ai->validate = new stdclass();
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->noEmpty = '%s cannot be empty.';
$lang->ai->validate->dirtyForm = 'The design step of %s has changed. Do you want to save and return it?';
$lang->ai->validate->nameNotUnique = 'A prompt with the same name already exists, please change the name.';
$lang->ai->prompts = new stdclass();
$lang->ai->prompts->common = 'Prompt';
+3 -2
View File
@@ -21,8 +21,9 @@ $lang->ai->nextStep = '下一步';
$lang->ai->goTesting = '去调试';
$lang->ai->validate = new stdclass();
$lang->ai->validate->noEmpty = '%s不能为空。';
$lang->ai->validate->dirtyForm = '%s的参数配置已变动,是否保存并返回?';
$lang->ai->validate->noEmpty = '%s不能为空。';
$lang->ai->validate->dirtyForm = '%s的参数配置已变动,是否保存并返回?';
$lang->ai->validate->nameNotUnique = '该名称已使用,请尝试其他名称。';
$lang->ai->prompts = new stdclass();
$lang->ai->prompts->common = '提词';
+6
View File
@@ -410,6 +410,9 @@ class aiModel extends model
$prompt->createdDate = helper::now();
$prompt->createdBy = $this->app->user->account;
/* Override uniqueness error message. */
$this->lang->error->unique = $this->lang->ai->validate->nameNotUnique;
$this->dao->insert(TABLE_PROMPT)
->data($prompt)
->autoCheck()
@@ -434,6 +437,9 @@ class aiModel extends model
$prompt->editedDate = helper::now();
$prompt->editedBy = $this->app->user->account;
/* Override uniqueness error message. */
$this->lang->error->unique = $this->lang->ai->validate->nameNotUnique;
$this->dao->update(TABLE_PROMPT)
->data($prompt)
->autoCheck()