From 6fbf9e500ae5e7fff03ae7981f4e5259b375a3ae Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 27 Nov 2024 16:53:04 +0800 Subject: [PATCH] * [task#133223,doing,0.5h] add hasStageData method. --- module/project/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/project/model.php b/module/project/model.php index 459b4cf8b1..5373dbac10 100755 --- a/module/project/model.php +++ b/module/project/model.php @@ -2676,6 +2676,23 @@ class projectModel extends model { if(empty($executionID)) return false; + $task = $this->dao->select('id')->from(TABLE_TASK)->where('execution')->eq($executionID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); + if(!empty($task)) return true; + + $effort = $this->dao->select('id')->from(TABLE_EFFORT)->where('execution')->eq($executionID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); + if(!empty($effort)) return true; + + $bug = $this->dao->select('id')->from(TABLE_BUG)->where('execution')->eq($executionID)->andWhere('deleted')->eq(0)->limit(1)->fetch(); + if(!empty($bug)) return true; + + $story = $this->dao->select('id')->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_PROJECTSTORY)->alias('t2')->on('t1.id=t2.story') + ->where('t2.project')->eq($executionID) + ->andWhere('t1.deleted')->eq(0) + ->limit(1)->fetch(); + if(!empty($story)) return true; + + return false; } }