* @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_closed_program extends baseCalc { public $dataset = 'getPrograms'; public $fieldList = array('status'); public $result = 0; public function calculate($row) { if($row->status == 'closed') $this->result += 1; } public function getResult($options = array()) { $records = array(array('value' => $this->result)); return $this->filterByOptions($records, $options); } }