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