From cd589f789bcb47f161e7c9f02c6065e8e7625c11 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 16 Mar 2021 16:54:18 +0800 Subject: [PATCH] * Fix a bug. --- module/testcase/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index c84f50db47..6f2782f65d 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1707,8 +1707,9 @@ class testcaseModel extends model if($storyChanged) { /* If the new related story isn't linked the project, unlink the case. */ + $projects = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($oldCase->story)->fetchAll('project'); $this->dao->delete()->from(TABLE_PROJECTCASE) - ->where('project')->eq($oldCase->project) + ->where('project')->in(array_keys($projects)) ->andWhere('`case`')->eq($oldCase->id) ->exec();