From 81197fe96155d90edde3371ece4cadff17ab3fdc Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 1 Sep 2022 09:35:56 +0800 Subject: [PATCH] * fix bug #26744 --- module/task/model.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index f0d5bc898b..ba21458b21 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -2823,15 +2823,16 @@ class taskModel extends model public function updateEstimate($estimateID) { $oldEstimate = $this->getEstimateById($estimateID); - $estimate = fixer::input('post')->get(); + $estimate = fixer::input('post')->cleanINT('consumed,left')->get(); $today = helper::today(); if($estimate->date > $today) return dao::$errors[] = $this->lang->task->error->date; + if($estimate->consumed < 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->record, '0'); + if($estimate->left < 0) return dao::$errors[] = sprintf($this->lang->error->ge, $this->lang->task->left, '0'); $task = $this->getById($oldEstimate->task); $this->dao->update(TABLE_TASKESTIMATE)->data($estimate) ->autoCheck() - ->check('consumed', 'notempty') ->where('id')->eq((int)$estimateID) ->exec();