From d5edee666daeb1739f91da76ee74540352d845c3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 10 Jun 2025 14:32:01 +0800 Subject: [PATCH] + [task#144594,doing,0.4h] add changed story metric. --- .../system/scale/count_of_changed_story.php | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 module/metric/calc/system/scale/count_of_changed_story.php diff --git a/module/metric/calc/system/scale/count_of_changed_story.php b/module/metric/calc/system/scale/count_of_changed_story.php new file mode 100644 index 0000000000..ef89d3546e --- /dev/null +++ b/module/metric/calc/system/scale/count_of_changed_story.php @@ -0,0 +1,42 @@ + + * @package + * @uses func + * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) + * @Link https://www.zentao.net + */ +class count_of_changed_story extends baseCalc +{ + public $dataset = ''; + + public $fieldList = array(); + + public $result = 0; + + public function calculate($row) + { + if(empty($row->changedDate) || $row->status == 'changing' || $row->status == 'reviewing') return false; + + if(!empty($row->executionStartDate) && !empty($row->executionEndDate) && $row->changedDate < $row->executionStartDate || $row->changedDate > $row->executionEndDate) return false; + $this->result ++; + } + + public function getResult($options = array()) + { + $records = array(array('value' => $this->result)); + return $this->filterByOptions($records, $options); + } +}