|
|
|
@ -1,12 +1,13 @@
|
|
|
|
|
<?php
|
|
|
|
|
if (!defined('BASEPATH'))
|
|
|
|
|
if (!defined('BASEPATH')) {
|
|
|
|
|
exit('No direct script access allowed');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class infofix extends CI_Controller
|
|
|
|
|
{
|
|
|
|
|
var $site_code = '';
|
|
|
|
|
public $site_code = '';
|
|
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
parent::__construct();
|
|
|
|
|
$this->load->model('Information_model');
|
|
|
|
@ -20,7 +21,7 @@ class infofix extends CI_Controller
|
|
|
|
|
/**
|
|
|
|
|
* 根据关键词搜索信息
|
|
|
|
|
*/
|
|
|
|
|
function list_info_by_keys()
|
|
|
|
|
public function list_info_by_keys()
|
|
|
|
|
{
|
|
|
|
|
// 防止超时
|
|
|
|
|
set_time_limit(0);
|
|
|
|
@ -68,7 +69,6 @@ class infofix extends CI_Controller
|
|
|
|
|
$pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// amp_json
|
|
|
|
|
$sub_content2 = array();
|
|
|
|
|
if ($info->amp_json) {
|
|
|
|
@ -105,7 +105,7 @@ class infofix extends CI_Controller
|
|
|
|
|
'sub_url' => $sub_url,
|
|
|
|
|
'sub_content' => $sub_content,
|
|
|
|
|
'sub_json' => $sub_content2,
|
|
|
|
|
'sub_body' => $sub_content3
|
|
|
|
|
'sub_body' => $sub_content3,
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -121,7 +121,7 @@ class infofix extends CI_Controller
|
|
|
|
|
/**
|
|
|
|
|
* 更新含有关键的信息
|
|
|
|
|
*/
|
|
|
|
|
function update_info_by_keys()
|
|
|
|
|
public function update_info_by_keys()
|
|
|
|
|
{
|
|
|
|
|
// json参数
|
|
|
|
|
$site = $this->input->get_post('site');
|
|
|
|
@ -196,7 +196,7 @@ class infofix extends CI_Controller
|
|
|
|
|
* 无条件获取信息内容
|
|
|
|
|
* @param mixed $ic_id
|
|
|
|
|
*/
|
|
|
|
|
function get_by_icid($ic_id)
|
|
|
|
|
public function get_by_icid($ic_id)
|
|
|
|
|
{
|
|
|
|
|
$ic = $this->infoContents_model->get_ic_contents2($ic_id);
|
|
|
|
|
$json = json_decode($this->infoMetas_model->get($ic_id, 'AMP_JSON'));
|
|
|
|
@ -207,14 +207,14 @@ class infofix extends CI_Controller
|
|
|
|
|
'state' => 0,
|
|
|
|
|
'ic_content' => $ic->ic_content,
|
|
|
|
|
'pc_use' => $use,
|
|
|
|
|
'json' => $json
|
|
|
|
|
'json' => $json,
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
echo json_encode(
|
|
|
|
|
array(
|
|
|
|
|
'state' => -1,
|
|
|
|
|
'msg' => 'not content by ' . $ic_id
|
|
|
|
|
'msg' => 'not content by ' . $ic_id,
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -223,7 +223,7 @@ class infofix extends CI_Controller
|
|
|
|
|
/**
|
|
|
|
|
* 无条件更新信息内容(上线前内容)
|
|
|
|
|
*/
|
|
|
|
|
function update_by_icid()
|
|
|
|
|
public function update_by_icid()
|
|
|
|
|
{
|
|
|
|
|
$ic_id = $this->input->get_post('ic_id');
|
|
|
|
|
$ic_content = $this->input->get_post('ic_content');
|
|
|
|
@ -234,7 +234,7 @@ class infofix extends CI_Controller
|
|
|
|
|
* 列举使用旧版构建工具的信息,用于批量替换更新。
|
|
|
|
|
* @param mixed $site
|
|
|
|
|
*/
|
|
|
|
|
function list_use_hb($site)
|
|
|
|
|
public function list_use_hb($site)
|
|
|
|
|
{
|
|
|
|
|
$rs = $this->infoContents_model->list_use_hb($site);
|
|
|
|
|
echo json_encode($rs);
|
|
|
|
@ -244,7 +244,7 @@ class infofix extends CI_Controller
|
|
|
|
|
* 转化旧版构建工具数据(上线前的准备)
|
|
|
|
|
* @param mixed $ic_id
|
|
|
|
|
*/
|
|
|
|
|
function migrate_hb($ic_id, $dev = 'prod')
|
|
|
|
|
public function migrate_hb($ic_id, $dev = 'prod')
|
|
|
|
|
{
|
|
|
|
|
// 本地测试参数
|
|
|
|
|
$api = 'https://hmk.arachina.com/beta/3733/server_render2';
|
|
|
|
@ -276,9 +276,9 @@ class infofix extends CI_Controller
|
|
|
|
|
$curl_rs = str_replace(array('<my_lmr_tpl>', '</my_lmr_tpl>'), '', $curl_rs);
|
|
|
|
|
// 强制更新信息内容
|
|
|
|
|
$this->infoContents_model->force_update($ic_id, $curl_rs);
|
|
|
|
|
echo $ic_id + ' @ ok @ ';
|
|
|
|
|
echo $ic_id+' @ ok @ ';
|
|
|
|
|
} else {
|
|
|
|
|
echo $ic_id + ' @ error @ ';
|
|
|
|
|
echo $ic_id+' @ error @ ';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|