* Refactor getProjectStats method.

This commit is contained in:
tianshujie
2023-08-17 10:03:22 +08:00
parent 41024edd47
commit f49087bfba
10 changed files with 361 additions and 141 deletions
@@ -2,6 +2,9 @@
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
zdTable('user')->gen(5);
su('admin');
zdTable('project')->gen(50);
$task = zdTable('task');
@@ -10,9 +13,9 @@ $task->gen(100);
/**
title=测试 programModel::create();
title=测试 programModel::computeProjectHours();
timeout=0
cid=1
pid=1
*/
@@ -25,7 +28,5 @@ $tasks = $tester->program->dao->select('id, project, estimate, consumed, `left`,
->andWhere('deleted')->eq(0)
->fetchGroup('project', 'id');
$hours = $tester->program->computeProjectHours($tasks);
r($tester->program->computeProjectHours(array())) && p() && e('0');
r($tester->program->computeProjectHours(array())) && p() && e('0');
r($tester->program->computeProjectHours($tasks)) && p('11:totalConsumed,totalEstimate,totalLeft,progress') && e('15,30,10,60');