From 96bcf278b9e5e0cd00aaa3ddce5e85673768fcf9 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Oct 2024 15:49:32 +0800 Subject: [PATCH] add backup --- application/controllers/infofix.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 8337f2f2..ed68ca8e 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -223,10 +223,18 @@ class infofix extends CI_Controller /** * 无条件更新信息内容(上线前内容) */ - public function update_by_icid() + public function update_by_icid($backup = 'no') { $ic_id = $this->input->get_post('ic_id'); $ic_content = $this->input->get_post('ic_content'); + + // 先备份 - 测试时不备份 + if ($backup == 'backup') { + $is = $this->infoContents_model->get_isid_by_icid($ic_id); + $ic = $this->infoContents_model->get_ic_contents2($ic_id); + $this->logs_model->backup($is->is_id, $ic->ic_content); + } + $rs = $this->infoContents_model->force_update($ic_id, $ic_content); echo json_encode(array('status' => 1)); } @@ -255,7 +263,7 @@ class infofix extends CI_Controller } /** - * 转化旧版构建工具数据(上线前的准备) + * 转化旧版构建工具数据(上线前的准备)- 不使用。 * @param mixed $ic_id */ public function migrate_hb($dev = 'prod')