From cb4fd5ffb1581fd80e7f2ea0bbf568d6bfe9254b Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Wed, 7 Jul 2021 13:42:12 +0800 Subject: [PATCH] * Fix bug. --- db/update15.0.3.sql | 1 + db/zentao.sql | 2 +- module/execution/view/storyestimate.html.php | 2 +- module/story/model.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/update15.0.3.sql b/db/update15.0.3.sql index c63491fc32..98d31b98e6 100644 --- a/db/update15.0.3.sql +++ b/db/update15.0.3.sql @@ -2,3 +2,4 @@ UPDATE `zt_block` SET `source`='execution' WHERE `source`='project' and `block`= ALTER TABLE `zt_story` MODIFY COLUMN `reviewedDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'; REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'story', '', 'reviewRules', 'allpass'); +ALTER TABLE `zt_storyestimate` MODIFY COLUMN `average` float NOT NULL; diff --git a/db/zentao.sql b/db/zentao.sql index 37f7339124..328e3bcce9 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -943,7 +943,7 @@ CREATE TABLE IF NOT EXISTS `zt_storyestimate` ( `story` mediumint(9) NOT NULL, `round` smallint(6) NOT NULL, `estimate` text NOT NULL, - `average` float(10,2) NOT NULL, + `average` float NOT NULL, `openedBy` varchar(30) NOT NULL, `openedDate` datetime NOT NULL, UNIQUE KEY `story` (`story`,`round`) diff --git a/module/execution/view/storyestimate.html.php b/module/execution/view/storyestimate.html.php index 0447371093..1ca8f19b73 100644 --- a/module/execution/view/storyestimate.html.php +++ b/module/execution/view/storyestimate.html.php @@ -54,7 +54,7 @@ account);?> account, "class='form-control'");?> estimate)):?> - estimate->{$user->account}) ? $estimateInfo->estimate->{$user->account}->estimate : '';?> + estimate->{$user->account}) ? $estimateInfo->estimate->{$user->account}->estimate : '';?> diff --git a/module/story/model.php b/module/story/model.php index 2ab5feeae3..e49ffb1e7f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4165,7 +4165,7 @@ class storyModel extends model dao::$errors[] = $this->lang->story->estimateMustBePlus; return false; } - $estimates[$account]['estimate'] = strpos($data->estimate[$key], '-') !== false ? (int)$data->estimate[$key] : $data->estimate[$key]; + $estimates[$account]['estimate'] = strpos($data->estimate[$key], '-') !== false ? (int)$data->estimate[$key] : (float)$data->estimate[$key]; }