* @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_finished_task extends baseCalc { public $dataset = 'getTasks'; public $fieldList = array('t1.status', 't1.closedReason'); public $result = 0; public function calculate($row) { if($row->status == 'done') $this->result ++; if($row->status == 'closed' and $row->closedReason == 'done') $this->result ++; } public function getResult($options = array()) { $records = $this->getRecords(array('value')); return $this->filterByOptions($records, $options); } }