list info

hotfix/远程访问多媒体中心
lmrwork 7 years ago
parent 179e0b9fe8
commit ef9fc1da89

@ -12,6 +12,7 @@ class Info_amp extends CI_Controller
//$this->permission->is_admin();
$this->load->model('InfoMetas_model');
$this->load->model('InfoContents_model');
$this->load->model('Information_model');
$this->site_code = $this->config->item('site_code');
//CORS TEST
header('Access-Control-Allow-Origin:*');
@ -200,6 +201,61 @@ class Info_amp extends CI_Controller
}
}
public function list_info_children()
{
$site = $this->input->get_post('site');
switch ($site) {
case 'https://www.viaje-a-china.com':
$site_code = 'vac';
break;
case 'https://www.voyageschine.com':
$site_code = 'vc';
break;
case 'https://www.arachina.com':
$site_code = 'jp';
break;
case 'https://www.chinahighlights.ru':
$site_code = 'ru';
break;
case 'https://www.viaggio-in-cina.it':
$site_code = 'it';
break;
case 'https://www.chinahighlights.com':
$site_code = 'cht';
break;
case 'https://www.chinarundreisen.com/':
$site_code = 'gm';
break;
default:
$site_code = false;
break;
}
$is_path = $this->input->get_post('is_path'); // '25693,278002094,'
if (!$site_code || !$is_path) {
echo json_encode(array(
'succ' => false,
'message' => 'list_info_children() -> 参数传递错误。'
));
return false;
}
$rs = $this->Information_model->get_list_by_path($is_path, false, $site_code);
if (!empty($rs)) {
$newrs = array();
foreach ($rs as $info) {
array_push($newrs, array(
'ic_url' => $info->ic_url,
'ic_id' => $info->ic_id
));
}
echo json_encode($newrs);
} else {
echo json_encode(array(
"succ" => false,
"message" => "list_info_children() -> 无数据返回。"
));
}
}
public function load_info()
{
$icid = $this->input->get_post('icid');

@ -34,6 +34,7 @@ class InfoMetas_model extends CI_Model {
return $query->result();
}
//列表所有含AMPmeta的信息。
public function list_amp($site_code) {
$sql = "
SELECT im.im_id

@ -74,14 +74,14 @@ class Information_model extends CI_Model {
}
//根据根节点路径获取子节点列表
function get_list_by_path($path, $level = false) {
function get_list_by_path($path, $level = false, $site_code = false) {
$this->init();
if ($level !== false) {
$this->level = " AND is1.is_level= '$level' ";
}
$this->path = " AND is1.is_path LIKE '$path%' ";
$this->orderBy = ' ORDER BY is1.is_level ASC, is1.is_sort ASC,is1.is_path ASC ';
return $this->GetList();
return $this->GetList('', $site_code);
}
//根据路径获取某一级别节点详细页
@ -129,7 +129,7 @@ class Information_model extends CI_Model {
return $this->GetList();
}
function GetList($filed = "") {
function GetList($filed = "", $site_code = "") {
$this->topNum ? $sql = "SELECT TOP " . $this->topNum : $sql = "SELECT ";
if (empty($filed)) {
$sql .= " is1.is_id, \n"
@ -187,7 +187,7 @@ class Information_model extends CI_Model {
$this->orderBy ? $sql.=$this->orderBy : false;
$query = $this->HT->query($sql, array($this->config->item('site_code')));
$query = $this->HT->query($sql, array($site_code ? $site_code : $this->config->item('site_code')));
//print_r($this->HT->queries);
if ($this->topNum === 1) {
if ($query->num_rows() > 0) {

Loading…
Cancel
Save