master
LMR 1 year ago
parent 9bff796497
commit 4719149e4c

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

Loading…
Cancel
Save