From 637132f6fdd1ee702da10f975f4e526c627b8cf1 Mon Sep 17 00:00:00 2001 From: liwenrui Date: Tue, 18 Jul 2023 10:58:00 +0800 Subject: [PATCH] * add quick switcher and title to prompt details. --- config/zentaopms.php | 1 + module/ai/control.php | 3 ++- module/ai/model.php | 4 +++- module/ai/view/promptview.html.php | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/zentaopms.php b/config/zentaopms.php index 2a5b2138c6..7a95d82c64 100644 --- a/config/zentaopms.php +++ b/config/zentaopms.php @@ -437,6 +437,7 @@ $config->objectTables['privlang'] = TABLE_PRIVLANG; $config->objectTables['privmanager'] = TABLE_PRIVMANAGER; $config->objectTables['privrelation'] = TABLE_PRIVRELATION; $config->objectTables['scene'] = TABLE_SCENE; +$config->objectTables['prompt'] = TABLE_PROMPT; $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme', 'visions'); $config->disabledFeatures = ''; diff --git a/module/ai/control.php b/module/ai/control.php index db24312651..fc0fc6df64 100644 --- a/module/ai/control.php +++ b/module/ai/control.php @@ -147,7 +147,8 @@ class ai extends control $prompt = $this->ai->getPromptById($id); $this->view->prompt = $prompt; - $this->view->title = $this->lang->ai->prompts->common; + $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('prompt', $id); + $this->view->title = "{$this->lang->ai->prompts->common}#{$prompt->id} $prompt->name"; $this->view->position[] = $this->lang->ai->prompts->common; $this->display(); diff --git a/module/ai/model.php b/module/ai/model.php index a0b5020935..22ea2306ef 100644 --- a/module/ai/model.php +++ b/module/ai/model.php @@ -373,13 +373,15 @@ class aiModel extends model */ public function getPrompts($module = '', $status = '', $order = 'id_desc', $pager = null) { - return $this->dao->select('*')->from(TABLE_PROMPT) + $prompts = $this->dao->select('*')->from(TABLE_PROMPT) ->where('1=1') ->beginIF(!empty($module))->andWhere('module')->eq($module)->fi() ->beginIF(!empty($status))->andWhere('status')->eq($status)->fi() ->orderBy($order) ->page($pager) ->fetchAll(); + $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'prompt'); + return $prompts; } /** diff --git a/module/ai/view/promptview.html.php b/module/ai/view/promptview.html.php index 157c1edf4b..874ba7d2b7 100644 --- a/module/ai/view/promptview.html.php +++ b/module/ai/view/promptview.html.php @@ -47,6 +47,10 @@ +
+ +
+