|
|
@ -19,52 +19,52 @@ 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
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_BODY');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_BODY');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_BODY', $html);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_BODY', $html);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_BODY', $html);
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_BODY', $html);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//json
|
|
|
|
//json
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_JSON');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_JSON');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_JSON', $json);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_JSON', $json);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_JSON', $json);
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_JSON', $json);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//css
|
|
|
|
//css
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_CSS');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_CSS');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_CSS', $css);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_CSS', $css);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_CSS', $css);
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_CSS', $css);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//script
|
|
|
|
//script
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_SCRIPT');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_SCRIPT');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_SCRIPT', $script);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_SCRIPT', $script);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_SCRIPT', $script);
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_SCRIPT', $script);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//schema
|
|
|
|
//schema
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_SCHEMA');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_SCHEMA', $schema);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_SCHEMA', $schema);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_SCHEMA', $schema);
|
|
|
|
$this->InfoMetas_model->update($icid, 'AMP_SCHEMA', $schema);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//status
|
|
|
|
//status
|
|
|
|
$meta = $this->InfoMetas_model->get($icid, 'AMP_STATUS');
|
|
|
|
$meta = $this->InfoMetas_model->get_post($icid, 'AMP_STATUS');
|
|
|
|
if ($meta === false) {
|
|
|
|
if ($meta === false) {
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_STATUS', $status);
|
|
|
|
$this->InfoMetas_model->add($icid, 'AMP_STATUS', $status);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -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,9 +97,9 @@ class Info_amp extends CI_Controller
|
|
|
|
));
|
|
|
|
));
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$json = $this->InfoMetas_model->get($icid, 'AMP_JSON');
|
|
|
|
$json = $this->InfoMetas_model->get_post($icid, 'AMP_JSON');
|
|
|
|
$status = $this->InfoMetas_model->get($icid, 'AMP_STATUS');
|
|
|
|
$status = $this->InfoMetas_model->get_post($icid, 'AMP_STATUS');
|
|
|
|
$schema = $this->InfoMetas_model->get($icid, 'AMP_SCHEMA');
|
|
|
|
$schema = $this->InfoMetas_model->get_post($icid, 'AMP_SCHEMA');
|
|
|
|
if ($json) {
|
|
|
|
if ($json) {
|
|
|
|
echo json_encode(array(
|
|
|
|
echo json_encode(array(
|
|
|
|
"succ" => true,
|
|
|
|
"succ" => true,
|
|
|
@ -116,9 +116,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 'http://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($icid, 'AMP_JSON');
|
|
|
|
|
|
|
|
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) {
|
|
|
|