This commit is contained in:
tianshujie
2022-06-16 16:12:37 +08:00
parent 641c13383b
commit d9731bb06c
2 changed files with 3 additions and 3 deletions

View File

@@ -12,4 +12,4 @@ DELETE FROM `zt_workflowaction` WHERE `module`='build' AND `action`='browse';
ALTER TABLE `zt_projectproduct` MODIFY COLUMN `plan` varchar(255) NOT NULL;
UPDATE `zt_project` SET `grade`=1 WHERE `type` in ('project', 'sprint', 'kanban');
UPDATE `zt_project` SET `grade`=1 WHERE `type` in ('sprint', 'kanban');

View File

@@ -1338,11 +1338,11 @@ class programModel extends model
$path = substr($childNode->path, strpos($childNode->path, ",{$programID},"));
/* Only program sets update grade. */
$grade = $childNode->type == 'program' ? $childNode->grade - $oldGrade + 1 : $childNode->grade;
$grade = in_array($childNode->type, array('program', 'project')) ? $childNode->grade - $oldGrade + 1 : $childNode->grade;
if($parent)
{
$path = rtrim($parent->path, ',') . $path;
$grade = $childNode->type == 'program' ? $parent->grade + $grade : $grade;
$grade = in_array($childNode->type, array('program', 'project'))? $parent->grade + $grade : $grade;
}
$this->dao->update(TABLE_PROGRAM)->set('path')->eq($path)->set('grade')->eq($grade)->where('id')->eq($childNode->id)->exec();