change if...else to switch...case,change now to today.

This commit is contained in:
zhouxin
2021-12-13 08:45:37 +00:00
parent 9567620ff4
commit 40f27795e1
2 changed files with 12 additions and 13 deletions
+2 -3
View File
@@ -1240,12 +1240,11 @@ class projectModel extends model
public function suspend($projectID)
{
$oldProject = $this->getById($projectID);
$now = helper::now();
$project = fixer::input('post')
->setDefault('status', 'suspended')
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', $now)
->setDefault('suspendedDate', $now)
->setDefault('lastEditedDate', helper::now())
->setDefault('suspendedDate', helper::today())
->remove('comment')->get();
$this->dao->update(TABLE_PROJECT)->data($project)