* @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 planned_period_of_project extends baseCalc { public $dataset = 'getAllProjects'; public $fieldList = array('t1.id', 't1.begin', 't1.end'); public $result = array(); public function calculate($row) { $this->result[$row->id] = (strtotime($row->end) - strtotime($row->begin))/86400; } public function getResult($options = array()) { $records = $this->getRecords(array('project', 'value')); return $this->filterByOptions($records, $options); } }