From 961b729d09cf805ac4b8d226d20cfb71d5a7da84 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Wed, 4 Jan 2012 00:15:05 +0000 Subject: [PATCH] * adjust the case search logic. --- module/testtask/control.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index 49383e4f98..a228602c7c 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -357,11 +357,12 @@ class testtask extends control } if($param == 'bystory') { - $build = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch(); + $stories = $this->dao->select('stories')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('stories'); + $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query) ->andWhere('product')->eq($productID) - ->andWhere('id')->notIN($linkedCases) - ->andWhere('story')->in($build->stories) + ->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi() + ->andWhere('story')->in($stories) ->andWhere('deleted')->eq(0) ->orderBy('id desc') ->page($pager) @@ -369,11 +370,11 @@ class testtask extends control } if($param == 'bybug') { - $build = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch(); + $bugs = $this->dao->select('bugs')->from(TABLE_BUILD)->where('id')->eq($task->build)->fetch('bugs'); $cases = $this->dao->select('*')->from(TABLE_CASE)->where($query) ->andWhere('product')->eq($productID) - ->andWhere('id')->notIN($linkedCases) - ->andWhere('fromBug')->in($build->bugs) + ->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi() + ->andWhere('fromBug')->in($bugs) ->andWhere('deleted')->eq(0) ->orderBy('id desc') ->page($pager)