Merge branch 'zentaopms_239_wangyuting' into 'zentaopms_239'

* Fix bug.

See merge request easycorp/zentaopms!5734
This commit is contained in:
王怡栋
2022-10-14 05:00:26 +00:00
2 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -99,7 +99,7 @@ class reportModel extends model
public function getExecutions($begin = 0, $end = 0)
{
$permission = common::hasPriv('report', 'showProject') or $this->app->user->admin;
$tasks = $this->dao->select('t1.*, t2.name as executionName, t3.name as projectName')->from(TABLE_TASK)->alias('t1')
$tasks = $this->dao->select('t1.*, IF(t3.multiple = "1", t2.name, "") as executionName, t3.name as projectName')->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t3')->on('t1.project = t3.id')
->where('t1.status')->ne('cancel')
@@ -124,6 +124,7 @@ class reportModel extends model
$executions[$executionID]->consumed = 0;
}
$executions[$executionID]->projectID = $task->project;
$executions[$executionID]->projectName = $task->projectName;
$executions[$executionID]->name = $task->executionName;
$executions[$executionID]->estimate += $task->estimate;
+7 -3
View File
@@ -58,11 +58,15 @@
</tr>
</thead>
<tbody>
<?php foreach($executions as $id =>$execution):?>
<?php foreach($executions as $id => $execution):?>
<tr class="text-center">
<td><?php echo $id;?></td>
<td class="text-left" title="<?php echo $execution->projectName;?>"><?php echo $execution->projectName;?></td>
<td class="text-left" title="<?php echo $execution->name;?>"><?php echo html::a($this->createLink('execution', 'view', "executionID=$id"), $execution->name);?></td>
<td class="text-left" title="<?php echo $execution->projectName;?>">
<?php echo $execution->name ? $execution->projectName : html::a($this->createLink('project', 'index', "projectID=$execution->projectID"), $execution->projectName);?>
</td>
<td class="text-left" title="<?php echo $execution->name;?>">
<?php echo $execution->name ? html::a($this->createLink('execution', 'view', "executionID=$id"), $execution->name) : '';?>
</td>
<td><?php echo round($execution->estimate, 2);?></td>
<td><?php echo round($execution->consumed, 2);?></td>
<?php $deviation = round($execution->consumed - $execution->estimate, 2);?>