From fab68298238e742c99266ebe6662bdeacccbf194 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Wed, 13 Jul 2022 08:36:47 +0800 Subject: [PATCH] * Fix bug for task #60395. --- module/testcase/model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index 0c58f2582e..816fd50b9b 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -285,7 +285,7 @@ class testcaseModel extends model ->leftJoin(TABLE_STORY)->alias('t4')->on('t3.story=t4.id') ->where('t1.project')->in($executions) ->beginIF(!empty($productID))->andWhere('t2.product')->eq((int)$productID)->fi() - ->beginIF($branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi() + ->beginIF(!empty($productID) and $branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi() ->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi() ->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi() ->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi() @@ -342,7 +342,7 @@ class testcaseModel extends model ->where('t1.project')->eq((int)$executionID) ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() ->beginIF(!empty($moduleID))->andWhere('t4.path')->like("%,$moduleID,%")->fi() - ->andWhere('t2.branch')->eq($branchID) + ->beginIF(!empty($productID))->andWhere('t2.branch')->eq($branchID)->fi() ->andWhere('t2.deleted')->eq('0') ->andWhere('t3.version > t2.storyVersion') ->andWhere("t3.status")->eq('active') @@ -358,7 +358,7 @@ class testcaseModel extends model ->beginIF($browseType != 'all' and $browseType != 'byModule')->andWhere('t2.status')->eq($browseType)->fi() ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() ->beginIF(!empty($moduleID))->andWhere('t3.path')->like("%,$moduleID,%")->fi() - ->andWhere('t2.branch')->eq($branchID) + ->beginIF(!empty($productID))->andWhere('t2.branch')->eq($branchID)->fi() ->andWhere('t2.deleted')->eq('0') ->orderBy($orderBy) ->page($pager) @@ -520,7 +520,7 @@ class testcaseModel extends model ->andWhere('t2.version > t1.storyVersion') ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() ->beginIF($this->app->tab == 'project')->andWhere('t3.project')->eq($this->session->project)->fi() - ->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi() + ->beginIF($branch !== 'all' and !empty($productID))->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($modules)->andWhere('t1.module')->in($modules)->fi() ->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi() ->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()