From 54621ee79caef9b83a63407994bb208fdaf73c62 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Sat, 9 May 2020 21:15:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=8E=92=E5=BA=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/common/Model/Task.php | 2 +- application/common/Model/TaskStages.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;