From da8347f2898af81fbe2ff268f58ebf0cf118f2dd Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 17 Aug 2020 15:16:19 +0800 Subject: [PATCH] * Add stage model update method. --- module/stage/model.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/module/stage/model.php b/module/stage/model.php index 34f2a54c19..928e1af022 100644 --- a/module/stage/model.php +++ b/module/stage/model.php @@ -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');