* Fix kanban details.

This commit is contained in:
孙广明
2021-11-08 15:39:35 +08:00
parent 1f49e46582
commit c2a9dd1d7b
3 changed files with 24 additions and 10 deletions
+3 -2
View File
@@ -428,8 +428,9 @@ $.extend($.fn.kanban.Constructor.DEFAULTS,
doingProjectCount = $doingProjectItems.find('.project-item').length;
doingExecutionCount = $doingProjectItems.find('.execution-item').length;
}
$kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount || 0);
$kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount || 0);
if(doingProjectCount > 0) $kanban.find('.kanban-header-col[data-type="doingProject"] > .title > .count').text(doingProjectCount);
if(doingExecutionCount > 0) $kanban.find('.kanban-header-col[data-type="doingExecution"] > .title > .count').text(doingExecutionCount);
},
onCreate(kanban)
{
+1 -1
View File
@@ -1362,7 +1362,7 @@ class productModel extends model
* @access public
* @return array
*/
public function getStats($orderBy = 'order_desc', $pager = null, $status = 'noclosed', $line = 0, $storyType = 'story', $programID = 0)
public function getStats($orderBy = 'order_asc', $pager = null, $status = 'noclosed', $line = 0, $storyType = 'story', $programID = 0)
{
$this->loadModel('report');
$this->loadModel('story');
+20 -7
View File
@@ -443,13 +443,26 @@ class weeklyModel extends model
$executions = $this->loadModel('execution')->getList($project, 'all', 'all', 0, 0, 0);
$executionIdList = array_keys($executions);
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_EFFORT)
->where('objectType')->eq('task')
->andWhere('execution')->in($executionIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->fetch('consumed');
if(isset($this->config->proVersion))
{
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_EFFORT)
->where('objectType')->eq('task')
->andWhere('execution')->in($executionIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->fetch('consumed');
}
else
{
$taskIdList = $this->dao->select('id')->from(TABLE_TASK)->where('execution')->in($executionIdList)->fetchPairs();
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_TASKESTIMATE)
->where('task')->in($taskIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->fetch('consumed');
}
return round($AC, 2);
}