From ed2f5a76580b9a18846e338b2e6c3f616ac0c837 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Mon, 5 Mar 2018 10:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEURL=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=94=9F=E6=88=90AMP=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 8caa36e8..e6e272e4 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -413,7 +413,7 @@ class Information extends CI_Controller { $this->update_cache($this->input->post('ic_url'), true); } - $meta_amp_status = get_meta($information->ic_id, 'AMP_STATUS'); + //德语站FAQ版块需要删除原来的文件才能更新静态 $site_code = $this->config->item('site_code'); $ic_url = $this->input->post('ic_url'); @@ -421,11 +421,7 @@ class Information extends CI_Controller { if ($site_code == 'gm' && substr($ic_url, 0, 5) == '/faq/') { $update_info_log = $this->update_cache($ic_url, true); } else if (strcasecmp($site_code, "cht") == 0 && !empty($auto_update_cache)) { - $update_url = $ic_url; - if ($meta_amp_status) { - $update_url = '/amp'.$ic_url; - } - $update_info_log = $this->update_cache($update_url); + $update_info_log = $this->update_cache($ic_url); } else if (strcasecmp($site_code, "cht") != 0) {//非cht站点 $update_info_log = $this->update_cache($ic_url); } @@ -499,7 +495,19 @@ class Information extends CI_Controller { switch ($this->config->item('site_code')) { case 'cht': - $url = 'http://184.172.113.219:22223' . $url; + $search_list = $this->Information_model->search_url($url); + $amp_request = FALSE; + foreach ($search_list as $key => $req_url) { + $meta_amp_status = get_meta($req_url->ic_id, 'AMP_STATUS'); + if ($meta_amp_status) { + $amp_request = TRUE; + } + } + if ($amp_request) { + $url = 'http://184.172.113.219:22223/amp' . $url; + } else { + $url = 'http://184.172.113.219:22223' . $url; + } break; case 'ah': if ($delete_only === true) {