diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index bce0c7b5..2a1777b2 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -11,7 +11,6 @@ class infofix extends CI_Controller parent::__construct(); $this->load->model('Information_model'); $this->load->model('infoContents_model'); - $this->load->model('logs_model'); $this->load->model('infoMetas_model'); $this->site_code = $this->input->get('site_code') ? $this->input->get('site_code') : $this->config->item('site_code'); } @@ -107,11 +106,11 @@ class infofix extends CI_Controller // json参数 $site = $this->input->get_post('site'); $keys = $this->input->get_post('keys'); - $keyArr = explode('@', $keys); // 250000343@oldurl@newurl@250000462 + $keyArr = explode('@', $keys); // ic_id@oldurl@newurl@is_id - sleep(2); - echo ($keys); - return true; + //sleep(2); + //echo ($keys); + //return true; // 容错 if (empty($site) || count($keyArr) != 4 || strpos($keys, '/') === false) { @@ -127,29 +126,29 @@ class infofix extends CI_Controller // ic_content $ic = $this->infoContents_model->get_ic_contents2($ic_id); - if ($ic) { - $this->logs_model->backup($is_id, $ic->ic_content); // 备份 - $ic->ic_content = mb_str_replace($oldStr, $newStr, $ic->ic_content); + if (!empty($ic)) { + $ic->ic_content = str_ireplace($oldStr, $newStr, $ic->ic_content); $this->infoContents_model->force_update($ic_id, $ic->ic_content); - $ic->ic_url = mb_str_replace($oldStr, $newStr, $ic->ic_url); + $ic->ic_url = str_ireplace($oldStr, $newStr, $ic->ic_url); $this->infoContents_model->force_update_url($ic_id, $ic->ic_url); } // amp_json $meta = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); - if ($meta) { - $this->logs_model->backup_meta($is_id, $meta->im_value, 'AMP_JSON'); // 备份 - $meta->im_value = mb_str_replace($oldStr, $newStr, $meta->im_value); + if (!empty($meta)) { + $meta->im_value = str_ireplace($oldStr, $newStr, $meta->im_value); $this->infoMetas_model->update($is_id, 'AMP_JSON', $meta->im_value); } // amp_body_pc $meta = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC'); - if ($meta) { - $this->logs_model->backup_meta($is_id, $meta->im_value, 'AMP_BODY_PC'); // 备份 - $meta->im_value = mb_str_replace($oldStr, $newStr, $meta->im_value); + if (!empty($meta)) { + $meta->im_value = str_ireplace($oldStr, $newStr, $meta->im_value); $this->infoMetas_model->update($is_id, 'AMP_BODY_PC', $meta->im_value); } + + print_r($keyArr); + } }