* Adjust status when the old status is done.

This commit is contained in:
daitingting
2018-07-09 09:56:07 +08:00
parent 29371f8b70
commit 6d2d35bff0
+7 -1
View File
@@ -2247,7 +2247,13 @@ class upgradeModel extends model
$this->dao->insert(TABLE_HISTORY)->set('`new`')->eq($action->actor)->set('`field`')->eq('closedBy')->set('`action`')->eq($action->id)->exec();
$this->dao->insert(TABLE_HISTORY)->set('`new`')->eq($action->date)->set('`old`')->eq('0000-00-00 00:00:00')->set('`field`')->eq('closedDate')->set('`action`')->eq($action->id)->exec();
$this->dao->update(TABLE_HISTORY)->set('`new`')->eq('closed')->where('`action`')->eq($action->id)->andWhere('field')->eq('status')->exec();
$this->dao->update(TABLE_PROJECT)->set('`status`')->eq('closed')->set('`closedBy`')->eq($action->actor)->set('`closedDate`')->eq($action->date)->where('id')->eq($action->objectID)->exec();
$this->dao->update(TABLE_PROJECT)
->set('`status`')->eq('closed')
->set('`closedBy`')->eq($action->actor)
->set('`closedDate`')->eq($action->date)
->where('id')->eq($action->objectID)
->andWhere('status')->eq('done')
->exec();
}
return !dao::isError();
}