*Finish task #45148.

This commit is contained in:
zhengrunyu
2021-11-30 09:22:04 +08:00
parent b3c8ee7ccb
commit e78c876216
10 changed files with 66 additions and 69 deletions

View File

@@ -704,25 +704,21 @@ class executionModel extends model
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->remove('comment')->get();
if($execution->realBegan == '')
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty;
return false;
}
if($execution->realBegan > $now)
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture;
return false;
}
$this->dao->update(TABLE_EXECUTION)->data($execution)->autoCheck()->where('id')->eq((int)$executionID)->exec();
if(!dao::isError())
{
if($execution->realBegan == '')
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotEmpty;
return false;
}
if($execution->realBegan > $now)
{
dao::$errors['realBegan'] = $this->lang->execution->realBeganNotFuture;
return false;
}
return common::createChanges($oldExecution, $execution);
}
if(!dao::isError()) return common::createChanges($oldExecution, $execution);
}
/**
@@ -869,25 +865,26 @@ class executionModel extends model
->setDefault('lastEditedDate', $now)
->remove('comment')
->get();
if($execution->realEnd == '')
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty;
return false;
}
if($execution->realEnd > $now)
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture;
return false;
}
$this->dao->update(TABLE_EXECUTION)->data($execution)
->autoCheck()
->where('id')->eq((int)$executionID)
->exec();
if(!dao::isError())
{
if($execution->realEnd == '')
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotEmpty;
return false;
}
if($execution->realEnd > $now)
{
dao::$errors['realEnd'] = $this->lang->execution->realEndNotFuture;
return false;
}
{
$this->loadModel('score')->create('execution', 'close', $oldExecution);
return common::createChanges($oldExecution, $execution);
}