From 76f1d93ce62658195ac3c3e371eae512a8fc8391 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Fri, 24 May 2024 10:31:44 +0800 Subject: [PATCH] add log --- application/controllers/infofix.php | 21 +++++++++++++++++---- application/models/information_model.php | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 69dbb165..b38bddb7 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -10,6 +10,8 @@ class infofix extends CI_Controller { parent::__construct(); $this->load->model('Information_model'); + $this->load->model('infoContents_model'); + $this->load->model('logs_model'); $this->site_code = $this->input->get('site_code') ? $this->input->get('site_code') : $this->config->item('site_code'); } @@ -104,18 +106,29 @@ class infofix extends CI_Controller // json参数 $site = $this->input->get_post('site'); $keys = $this->input->get_post('keys'); - $keyArr = explode('@', $keys); + $keyArr = explode('@', $keys); // 250000343@oldurl@newurl@ - sleep(3); - echo json_encode($keyArr); + sleep(2); + echo ($keys); return true; // 容错 - if (empty($site) || empty($keys) || strpos($keys, '/') === false) { + if (empty($site) || count($keyArr) != 4 || strpos($keys, '/') === false) { echo json_encode(array()); return false; } + // 参数解析 + $ic_id = $keyArr[0]; + $oldStr = $keyArr[1]; + $newStr = $keyArr[2]; + $is_id = $keyArr[3]; + + // 先备份 + //$this->logs_model->backup() + //$ic = $this->infoContents_model->get_ic_contents2($ic_id); + //$ic->info_content = mb_str_replace($oldStr, $newStr, $keyArr); + } } diff --git a/application/models/information_model.php b/application/models/information_model.php index 9f71cfb7..8a2bf97f 100644 --- a/application/models/information_model.php +++ b/application/models/information_model.php @@ -799,7 +799,7 @@ class Information_model extends CI_Model } $search = ' AND (1=0 ' . $keysql . ')'; $sql = " - SELECT ic_id, ic_url, ic_content, m1.im_value AS amp_json, m2.im_value AS amp_body + SELECT is_id, ic_id, ic_url, ic_content, m1.im_value AS amp_json, m2.im_value AS amp_body FROM infoStructures is1 INNER JOIN infoContents ic ON ic.ic_id = is1.is_ic_id