* Adjust the holiday module.

This commit is contained in:
leiyong
2020-12-08 11:08:32 +08:00
parent 653f817e83
commit d2ddce5e7c
2 changed files with 12 additions and 15 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
<?php
if(!isset($config->holiday)) $config->holiday = new stdclass();
$config->holiday->require = new stdclass();
$config->holiday->require->create = 'name,begin,end,year';
$config->holiday->require->edit = 'name,begin,end,year';
$config->holiday->require->create = 'name,begin,end';
$config->holiday->require->edit = 'name,begin,end';
+10 -13
View File
@@ -66,26 +66,23 @@ class holidayModel extends model
$holiday = fixer::input('post')->get();
$holiday->year = substr($holiday->begin, 0, 4);
$this->dao->insert(TABLE_HOLIDAY)
->data($holiday)
$this->dao->insert(TABLE_HOLIDAY)->data($holiday)
->autoCheck()
->batchCheck($this->config->holiday->require->create, 'notempty')
->check('end', 'ge', $holiday->begin)
->exec();
if(dao::isError()) return false;
if(!dao::isError())
{
$beginDate = $this->post->begin;
$endDate = $this->post->end;
$beginDate = $this->post->begin;
$endDate = $this->post->end;
/* Update project. */
$this->updateProjectPlanDuration($beginDate, $endDate);
$this->updateProjectRealDuration($beginDate, $endDate);
/* Update project. */
$this->updateProjectPlanDuration($beginDate, $endDate);
$this->updateProjectRealDuration($beginDate, $endDate);
/* Update task. */
$this->updateTaskPlanDuration($beginDate, $endDate);
$this->updateTaskRealDuration($beginDate, $endDate);
}
/* Update task. */
$this->updateTaskPlanDuration($beginDate, $endDate);
$this->updateTaskRealDuration($beginDate, $endDate);
return $this->dao->lastInsertID();
}