diff --git a/module/execution/model.php b/module/execution/model.php index 7011a5aa37..b31e98d682 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -710,7 +710,7 @@ class executionModel extends model dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty; return false; } - if($execution->realBegan > $now) + if($execution->realBegan > helper::today()) { dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture; return false; @@ -789,7 +789,7 @@ class executionModel extends model $now = helper::now(); $execution = fixer::input('post') - ->setDefault('realEnd','') + ->setDefault('realEnd', '') ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) @@ -872,7 +872,7 @@ class executionModel extends model return false; } - if($execution->realEnd > $now) + if($execution->realEnd > helper::today()) { dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture; return false; @@ -884,7 +884,7 @@ class executionModel extends model ->exec(); if(!dao::isError()) - { + { $this->loadModel('score')->create('execution', 'close', $oldExecution); return common::createChanges($oldExecution, $execution); } diff --git a/module/project/model.php b/module/project/model.php index 062183813c..9e976fbc05 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1288,7 +1288,7 @@ class projectModel extends model dao::$errors['realEnd'] = $this->lang->project->realEndNotEmpty; return false; } - if($project->realEnd > $now) + if($project->realEnd > helper::today()) { dao::$errors['realEnd'] = $this->lang->project->realEndNotFuture; return false; @@ -1300,7 +1300,7 @@ class projectModel extends model ->exec(); if(!dao::isError()) - { + { $this->loadModel('score')->create('project', 'close', $oldProject); return common::createChanges($oldProject, $project); }