add force ic_url

master
LMR 1 year ago
parent 76f1d93ce6
commit 9bff796497

@ -12,6 +12,7 @@ class infofix extends CI_Controller
$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');
}
@ -106,7 +107,7 @@ class infofix extends CI_Controller
// json参数
$site = $this->input->get_post('site');
$keys = $this->input->get_post('keys');
$keyArr = explode('@', $keys); // 250000343@oldurl@newurl@
$keyArr = explode('@', $keys); // 250000343@oldurl@newurl@250000462
sleep(2);
echo ($keys);
@ -124,11 +125,31 @@ class infofix extends CI_Controller
$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);
// 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);
$this->infoContents_model->force_update($ic_id, $ic->ic_content);
$ic->ic_url = mb_str_replace($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);
$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);
$this->infoMetas_model->update($is_id, 'AMP_BODY_PC', $meta->im_value);
}
}
}

@ -281,7 +281,7 @@ class InfoContents_model extends CI_Model
return $query;
}
//删除信息
//强制更新信息
function force_update($ic_id, $ic_content)
{
$sql = "UPDATE infoContents SET ic_content = N? WHERE ic_id = ?";
@ -289,6 +289,14 @@ class InfoContents_model extends CI_Model
return $query;
}
//强制更新信息
function force_update_url($ic_id, $ic_url)
{
$sql = "UPDATE infoContents SET ic_url = N? WHERE ic_id = ?";
$query = $this->HT->query($sql, array($ic_url, $ic_id));
return $query;
}
//删除信息
function Delete($ic_id)
{

Loading…
Cancel
Save