From a183d31460be5e9a79bd0ba611209fa9bf7360d6 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Tue, 22 Aug 2023 10:52:56 +0800 Subject: [PATCH] * Add 2 function for upgrade. --- module/upgrade/model.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 044e4866a1..7d3cb75232 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -697,6 +697,8 @@ class upgradeModel extends model $this->loadModel('product')->refreshStats(true); $this->loadModel('program')->refreshStats(true); $this->updatePivotFieldsType(); + $this->initActionRecent(); + $this->addCreateAction4Story(); break; } @@ -9707,4 +9709,28 @@ class upgradeModel extends model $this->dao->update(TABLE_PIVOT)->data($data)->where('id')->eq($pivot->id)->exec(); } } + + /** + * Init recent action for new table. + * + * @access public + * @return void + */ + public function initActionRecent() + { + $time = date("Y-m-d H:i:s", strtotime("-1 month")); + $sql = "INSERT INTO `zt_actionrecent`(`objectType`,`objectID`,`product`,`project`,`execution`,`actor`,`action`,`date`,`comment`,`extra`,`read`,`vision`,`efforted`) SELECT `objectType`,`objectID`,`product`,`project`,`execution`,`actor`,`action`,`date`,`comment`,`extra`,`read`,`vision`,`efforted` FROM `zt_action` WHERE `date` >= '$time';"; + + $this->dbh->exec($sql); + } + + /** + * Init recent action for new table. + * + * @access public + * @return void + */ + public function addCreateAction4Story() + { + } }