* @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_wait_execution_in_project extends baseCalc { public $dataset = 'getExecutions'; public $fieldList = array('t1.project', 't1.status'); public $result = array(); public function calculate($row) { $project = $row->project; $status = $row->status; if(!isset($this->result[$project])) $this->result[$project] = 0; if($status == 'wait') $this->result[$project] += 1; } public function getResult($options = array()) { $records = $this->getRecords(array('project', 'value')); return $this->filterByOptions($records, $options); } }