* Add stage model update method.

This commit is contained in:
holan20180123
2020-08-17 15:16:19 +08:00
parent 5f441606bb
commit da8347f289
+15
View File
@@ -14,6 +14,21 @@ class stageModel extends model
return false;
}
public function update($stageID)
{
$oldStage = $this->dao->select('*')->from(TABLE_STAGE)->where('id')->eq((int)$stageID)->fetch();
$stage = fixer::input('post')
->add('editedBy', $this->app->user->account)
->add('editedDate', helper::today())
->get();
$this->dao->update(TABLE_STAGE)->data($stage)->autoCheck()->where('id')->eq((int)$stageID)->exec();
if(!dao::isError()) return common::createChanges($oldStage, $stage);
return false;
}
public function getStages()
{
return $this->dao->select('*')->from(TABLE_STAGE)->where('deleted')->eq(0)->fetchAll('id');