diff --git a/application/common/Model/Task.php b/application/common/Model/Task.php index 281524b..d84caa6 100644 --- a/application/common/Model/Task.php +++ b/application/common/Model/Task.php @@ -481,7 +481,7 @@ class Task extends CommonModel $nextTask = self::where(['code' => $nextCode])->field('sort')->find(); $nextPreTask = self::where('sort', '<', $nextTask['sort'])->where('code', '<>', $nextCode)->where('stage_code', '=', $toStageCode)->where('done', $done)->order('sort desc')->find(); $nextPreTaskSort = $nextPreTask ? $nextPreTask['sort'] : 0; - $newSort = (int)($nextTask['sort'] - $nextPreTaskSort) / 2; + $newSort = (int)($nextTask['sort'] + $nextPreTaskSort) / 2; } else { $maxSort = self::where('stage_code', '=', $toStageCode)->where('done', $done)->max('sort'); $newSort = $maxSort + 500; diff --git a/application/common/Model/TaskStages.php b/application/common/Model/TaskStages.php index c0e810e..b554c39 100644 --- a/application/common/Model/TaskStages.php +++ b/application/common/Model/TaskStages.php @@ -190,7 +190,7 @@ class TaskStages extends CommonModel if ($nextCode) { $nextPreStage = self::where('sort', '<', $nextStage['sort'])->where('code', '<>', $nextCode)->where('project_code', '=', $projectCode)->order('sort desc')->find(); $nextPreStageSort = $nextPreStage ? $nextPreStage['sort'] : 0; - $newSort = (int)($nextStage['sort'] - $nextPreStageSort) / 2; + $newSort = (int)($nextStage['sort'] + $nextPreStageSort) / 2; } else { $maxSort = self::where('project_code', $projectCode)->max('sort'); $newSort = $maxSort + 500;