master
LMR 10 months ago
parent 25727d79c2
commit 01d126c115

@ -1,12 +1,13 @@
<?php <?php
if (!defined('BASEPATH')) if (!defined('BASEPATH')) {
exit('No direct script access allowed'); exit('No direct script access allowed');
}
class infofix extends CI_Controller class infofix extends CI_Controller
{ {
var $site_code = ''; public $site_code = '';
function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->load->model('Information_model'); $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); 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)); $pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key));
} }
// amp_json // amp_json
$sub_content2 = array(); $sub_content2 = array();
if ($info->amp_json) { if ($info->amp_json) {
@ -105,7 +105,7 @@ class infofix extends CI_Controller
'sub_url' => $sub_url, 'sub_url' => $sub_url,
'sub_content' => $sub_content, 'sub_content' => $sub_content,
'sub_json' => $sub_content2, '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参数 // json参数
$site = $this->input->get_post('site'); $site = $this->input->get_post('site');
@ -196,7 +196,7 @@ class infofix extends CI_Controller
* 无条件获取信息内容 * 无条件获取信息内容
* @param mixed $ic_id * @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); $ic = $this->infoContents_model->get_ic_contents2($ic_id);
$json = json_decode($this->infoMetas_model->get($ic_id, 'AMP_JSON')); $json = json_decode($this->infoMetas_model->get($ic_id, 'AMP_JSON'));
@ -207,14 +207,14 @@ class infofix extends CI_Controller
'state' => 0, 'state' => 0,
'ic_content' => $ic->ic_content, 'ic_content' => $ic->ic_content,
'pc_use' => $use, 'pc_use' => $use,
'json' => $json 'json' => $json,
) )
); );
} else { } else {
echo json_encode( echo json_encode(
array( array(
'state' => -1, '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_id = $this->input->get_post('ic_id');
$ic_content = $this->input->get_post('ic_content'); $ic_content = $this->input->get_post('ic_content');
@ -234,7 +234,7 @@ class infofix extends CI_Controller
* 列举使用旧版构建工具的信息,用于批量替换更新。 * 列举使用旧版构建工具的信息,用于批量替换更新。
* @param mixed $site * @param mixed $site
*/ */
function list_use_hb($site) public function list_use_hb($site)
{ {
$rs = $this->infoContents_model->list_use_hb($site); $rs = $this->infoContents_model->list_use_hb($site);
echo json_encode($rs); echo json_encode($rs);
@ -244,7 +244,7 @@ class infofix extends CI_Controller
* 转化旧版构建工具数据(上线前的准备) * 转化旧版构建工具数据(上线前的准备)
* @param mixed $ic_id * @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'; $api = 'https://hmk.arachina.com/beta/3733/server_render2';

Loading…
Cancel
Save