From efb17b2f05b080f4c2d7a7139d2f4e228848ae70 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Mon, 7 Aug 2023 17:20:02 +0800 Subject: [PATCH] * make an exception for waterfall model project. --- module/ai/model.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/module/ai/model.php b/module/ai/model.php index 6d7b899fd4..78ba224fb3 100644 --- a/module/ai/model.php +++ b/module/ai/model.php @@ -963,9 +963,20 @@ class aiModel extends model } elseif($module == 'project') { - $objectId = $this->dao->select('max(id) as maxId')->from(TABLE_PROJECT) - ->where('id')->in($this->app->user->view->projects) - ->fetch('maxId'); + /* programplan/create only exist in the waterfall model project. */ + if(strpos($prompt->targetForm, 'programplan/create')) + { + $objectId = $this->dao->select('max(id) as maxId')->from(TABLE_PROJECT) + ->where('id')->in($this->app->user->view->projects) + ->andWhere('model')->eq('waterfall') + ->fetch('maxId'); + } + else + { + $objectId = $this->dao->select('max(id) as maxId')->from(TABLE_PROJECT) + ->where('id')->in($this->app->user->view->projects) + ->fetch('maxId'); + } } elseif($module == 'story') {