From b658a98de3630f72ef30b195174c3fcf576dce33 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 18 Nov 2021 14:13:32 +0800 Subject: [PATCH] Fix some problem. --- module/common/model.php | 8 ++++---- module/execution/control.php | 1 + module/execution/model.php | 10 +++++----- module/task/control.php | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 94e4c2c146..4bca64e290 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -65,20 +65,20 @@ class commonModel extends model if($thisModule == 'execution') { $executionID = $objectID; - $execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); + $execution = $this->dao->select('id, project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch(); $project = $this->syncProjectStatus($execution); $this->syncProgramStatus($project); } if($thisModule == 'project') { $projectID = $objectID; - $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch(); + $project = $this->dao->select('id, parent, path')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch(); $this->syncProgramStatus($project); } if($thisModule == 'program') { $programID = $objectID; - $program = $this->dao->select('*')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch(); + $program = $this->dao->select('id, parent, path')->from(TABLE_PROGRAM)->where('id')->eq($programID)->fetch(); $this->syncProgramStatus($program); } } @@ -103,9 +103,9 @@ class commonModel extends model ->orderBy('id_desc') ->fetchPairs(); + $this->dao->update(TABLE_PROGRAM)->set('status')->eq('doing')->where('id')->in($waitList)->exec(); foreach($waitList as $programID) { - $this->dao->update(TABLE_PROGRAM)->set('status')->eq('doing')->where('id')->eq($programID)->exec(); $this->loadModel('action')->create('program', $programID, 'syncprogram'); } } diff --git a/module/execution/control.php b/module/execution/control.php index 58caaea281..22cce87181 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1576,6 +1576,7 @@ class execution extends control $actionID = $this->loadModel('action')->create($this->objectType, $executionID, 'Edited'); $this->action->logHistory($actionID, $changes); + $syncExecution = ''; foreach($changes as $changeField) { if($changeField['field'] == 'status' && $changeField['old'] =='wait' && $changeField['new'] =='doing') diff --git a/module/execution/model.php b/module/execution/model.php index 98fbb8e5bf..9f0c82c74f 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -578,12 +578,12 @@ class executionModel extends model $this->loadModel('user'); $executions = array(); - $allChanges = array(); - $data = fixer::input('post')->get(); + $allChanges = array(); + $data = fixer::input('post')->get(); $oldExecutions = $this->getByIdList($this->post->executionIDList); - $nameList = array(); - $codeList = array(); - $projectModel = ''; + $nameList = array(); + $codeList = array(); + $projectModel = 'scrum'; /* Replace required language. */ if($this->app->tab == 'project') diff --git a/module/task/control.php b/module/task/control.php index 3cd0eb2f55..dd882c45c4 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -467,19 +467,19 @@ class task extends control if(!empty($allChanges)) { /* updateStatus is a description of whether to update the responsibility performance*/ - $updateStatus = false; + $waitTaskID = false; foreach($allChanges as $taskID => $changes) { if(empty($changes)) continue; /* Determine whether the status of a task has been changed, if the status of a task has been changed, set $updateStatus to taskID*/ - if($updateStatus == false) + if($waitTaskID == false) { foreach($changes as $changeField) { if($changeField['field'] == 'status' && $changeField['new'] == 'doing') { - $updateStatus = $taskID; + $waitTaskID = $taskID; break; } } @@ -501,7 +501,7 @@ class task extends control } } } - if($updateStatus !== false) $this->loadModel('common')->syncPPEStatus($updateStatus); + if($waitTaskID !== false) $this->loadModel('common')->syncPPEStatus($waitTaskID); } } $this->loadModel('score')->create('ajax', 'batchOther');