* Adjust code for slow page.

This commit is contained in:
王怡栋
2024-04-09 10:48:05 +08:00
parent 26f9b01286
commit 49697c7c45
7 changed files with 7 additions and 17 deletions
+1 -1
View File
@@ -1511,7 +1511,7 @@ class actionModel extends model
$condition .= " OR (`objectID` in ($programCondition) AND `objectType` = 'program')";
$efforts = $this->dao->select('id')->from(TABLE_EFFORT)
->where($condition)
->where("($condition)")
->beginIF($period != 'all')
->beginIF(isset($begin))->andWhere('date')->gt($begin)->fi()
->beginIF(isset($end))->andWhere('date')->lt($end)->fi()
+1
View File
@@ -81,6 +81,7 @@ class admin extends control
*/
public function ajaxSetZentaoData()
{
session_write_close();
if(helper::isIntranet()) return $this->send(array('result' => 'ignore'));
$hasInternet = $this->admin->checkInternet();
+1 -1
View File
@@ -2184,7 +2184,7 @@ class productModel extends model
}
}
$cases = $this->dao->select('story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll('story');
$cases = empty($storyIdList) ? array() : $this->dao->select('story')->from(TABLE_CASE)->where('story')->in($storyIdList)->andWhere('deleted')->eq(0)->fetchAll('story');
$rate = count($stories) == 0 || $rateCount == 0 ? 0 : round(count($cases) / $rateCount, 2);
$storyCommon = $this->lang->SRCommon;
+2 -2
View File
@@ -133,7 +133,7 @@ class productplanModel extends model
if(!empty($plans))
{
$plans = $this->reorder4Children($plans);
$planIdList = array_keys($plans);
$planIdList = array_filter(array_keys($plans));
$planProjects = array();
foreach($planIdList as $planID)
@@ -159,7 +159,7 @@ class productplanModel extends model
->fetchGroup('plan', 'id');
}
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where("plan")->in($planIdList)->andWhere('deleted')->eq(0)->fetchGroup('plan', 'id');
$bugs = $this->dao->select('id,plan')->from(TABLE_BUG)->where("plan")->in($planIdList)->andWhere('deleted')->eq(0)->fetchGroup('plan', 'id');
$parentStories = $parentBugs = $parentHour = array();
foreach($plans as $plan)
{
-12
View File
@@ -106,18 +106,6 @@ function loadModules(tr, caseID, link, isAddDitto, branch)
$('#module' + caseID).parent('td').load(link, function(data)
{
if(canImportModules[branch][caseID] != undefined && Object.keys(canImportModules[branch][caseID]).length > 0)
{
$('tr select#module').children().each(function()
{
moduleID = $(this).val();
if(canImportModules[branch][caseID][moduleID] == undefined)
{
$(this).remove();
}
})
}
tr.find('#module').chosen();
tr.find('#module').attr({"id": 'module' + caseID, "name": 'module[' + caseID + ']'});
tr.find('#module' + caseID).removeAttr('onchange');
+2
View File
@@ -2555,6 +2555,8 @@ class testcaseModel extends model
public function appendData($cases, $type = 'case', $caseIdlist = array())
{
if(empty($caseIdlist)) $caseIdList = array_keys($cases);
$caseIdList = array_filter($caseIdList);
if($type == 'case')
{
$caseBugs = $this->dao->select('count(*) as count, `case`')->from(TABLE_BUG)->where('`case`')->in($caseIdList)->andWhere('deleted')->eq(0)->groupBy('`case`')->fetchPairs('case', 'count');
@@ -13,7 +13,6 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('flow', $config->global->flow);?>
<?php js::set('ditto', $lang->testcase->ditto);?>
<?php js::set('canImportModules', $canImportModules);?>
<?php js::set('rawModule', $this->app->rawModule);?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>