zentaopms/extension/max/task/ext/model/hook/finish.zentaomax.php
2023-05-16 10:50:42 +08:00

15 lines
588 B
PHP

<?php
/* Update realDuration. */
$finishedDate = $this->post->finishedDate;
$taskInfo = $this->dao->select('realStarted')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch();
$realStarted = $taskInfo->realStarted;
if(!empty($realStarted) and $realStarted != '0000-00-00 00:00:00')
{
$realDuration = $this->loadModel('holiday')->getActualWorkingDays($realStarted, $finishedDate);
$realDuration = count($realDuration);
$this->dao->update(TABLE_TASK)->set('realDuration')->eq($realDuration)->where('id')->eq($taskID)->exec();
}
?>