Merge branch 'master' of gitee.com:hainatravel/information-system

hotfix/远程访问多媒体中心
尹诚诚 7 years ago
commit f3669ce733

@ -19,13 +19,13 @@ class Info_amp extends CI_Controller
public function save_amp() public function save_amp()
{ {
$icid = $this->input->post('icid'); $icid = $this->input->get_post('icid');
$json = $this->input->post('json'); $json = $this->input->get_post('json');
$html = $this->input->post('html'); $html = $this->input->get_post('html');
$css = $this->input->post('css'); $css = $this->input->get_post('css');
$schema = $this->input->post('schema'); $schema = $this->input->get_post('schema');
$script = $this->input->post('script'); $script = $this->input->get_post('script');
$status = $this->input->post('status'); $status = $this->input->get_post('status');
if ($icid && $json && $html) { if ($icid && $json && $html) {
try { try {
//html //html
@ -89,7 +89,7 @@ class Info_amp extends CI_Controller
public function load_amp() public function load_amp()
{ {
$icid = $this->input->post('icid'); $icid = $this->input->get_post('icid');
if (!$icid) { if (!$icid) {
echo json_encode(array( echo json_encode(array(
"succ" => false, "succ" => false,
@ -97,6 +97,42 @@ class Info_amp extends CI_Controller
)); ));
return false; return false;
} }
//信息~返回信息
$ic = $this->InfoContents_model->get_ic_contents2($icid);
if (empty($ic)) {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 无信息"
));
return false;
}
switch (strtolower($ic->ic_sitecode)) {
case 'vac':
$site = 'https://www.viaje-a-china.com';
break;
case 'vc':
$site = 'https://www.voyageschine.com';
break;
case 'jp':
$site = 'https://www.arachina.com';
break;
case 'ru':
$site = 'https://www.chinahighlights.ru';
break;
case 'it':
$site = 'https://www.viaggio-in-cina.it';
break;
case 'cht':
$site = 'https://www.chinahighlights.com';
break;
case 'gm':
$site = 'https://www.chinarundreisen.com/';
break;
default:
$site = '';
break;
}
$json = $this->InfoMetas_model->get($icid, 'AMP_JSON'); $json = $this->InfoMetas_model->get($icid, 'AMP_JSON');
$status = $this->InfoMetas_model->get($icid, 'AMP_STATUS'); $status = $this->InfoMetas_model->get($icid, 'AMP_STATUS');
$schema = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA'); $schema = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA');
@ -104,6 +140,7 @@ class Info_amp extends CI_Controller
echo json_encode(array( echo json_encode(array(
"succ" => true, "succ" => true,
"icid" => $icid, "icid" => $icid,
"icurl" => $site.$ic->ic_url,
"json" => $json, "json" => $json,
"schema" => $schema, "schema" => $schema,
"status" => $status "status" => $status
@ -116,9 +153,56 @@ class Info_amp extends CI_Controller
} }
} }
public function list_amp()
{
$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;
}
if (!$site_code) {
echo json_encode(array(
"succ" => false,
"message" => "list_amp() -> 参数传递错误。"
));
return false;
}
$rs = $this->InfoMetas_model->list_amp($site_code);
if (!empty($rs)) {
echo json_encode($rs);
} else {
echo json_encode(array(
"succ" => false,
"message" => "load_amp() -> 无数据返回。"
));
}
}
public function load_info() public function load_info()
{ {
$icid = $this->input->post('icid'); $icid = $this->input->get_post('icid');
if ($icid) { if ($icid) {
$ic = $this->InfoContents_model->get_ic_contents2($icid); $ic = $this->InfoContents_model->get_ic_contents2($icid);
if ($ic) { if ($ic) {
@ -143,6 +227,4 @@ class Info_amp extends CI_Controller
)); ));
} }
} }
} }

@ -126,7 +126,7 @@ class InfoContents_model extends CI_Model
public function get_ic_contents2($ic_id) public function get_ic_contents2($ic_id)
{ {
$sql="SELECT top 1 ic_id, ic_content, ic_title, ic_url, ic_photo from infoContents where ic_id=?"; $sql="SELECT top 1 ic_id, ic_content, ic_title, ic_url, ic_photo, ic_sitecode from infoContents where ic_id=?";
$query=$this->HT->query($sql,array($ic_id)); $query=$this->HT->query($sql,array($ic_id));
if ($query->result()) if ($query->result())
{ {

@ -34,6 +34,26 @@ class InfoMetas_model extends CI_Model {
return $query->result(); return $query->result();
} }
public function list_amp($site_code) {
$sql = "
SELECT im.im_id
,im.im_ic_id
,c.ic_url
FROM infoMetas im
inner join infoContents c
on c.ic_id = im.im_ic_id
left join infoMetas im2
on im2.im_ic_id = im.im_ic_id and im2.im_key = 'AMP_STATUS'
left join infoMetas im3
on im3.im_ic_id = im.im_ic_id and im2.im_key = 'AMP_SCHEMA'
WHERE im.im_key = 'AMP_JSON'
and c.ic_sitecode = ?
and CONVERT(varchar, im2.im_value) = '1'
";
$query = $this->HT->query($sql, array($site_code));
return $query->result();
}
function get($im_ic_id, $im_key) { function get($im_ic_id, $im_key) {
$sql = "SELECT im.im_value \n" $sql = "SELECT im.im_value \n"
. "FROM infoMetas im \n" . "FROM infoMetas im \n"

Loading…
Cancel
Save