From 26819f4e345988f99ec741495f131919fd905f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Fri, 12 Oct 2018 16:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ECT=E8=AF=BB=E5=8F=96=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=B9=B3=E5=8F=B0AMP=E5=86=85=E5=AE=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/CT_AMP_Loader.php | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 application/controllers/CT_AMP_Loader.php diff --git a/application/controllers/CT_AMP_Loader.php b/application/controllers/CT_AMP_Loader.php new file mode 100644 index 00000000..1925477d --- /dev/null +++ b/application/controllers/CT_AMP_Loader.php @@ -0,0 +1,51 @@ +load->model('information_model'); + $this->load->model('infoMetas_model'); + $this->load->library('Tags_analysis'); + } + + // http://localhost:8002/guide-use.php/amp_loader/test/?info_url=/yangtzecruise/ + /** + * 加载已经发布的页面 + */ + public function load() { + $info_url = $this->input->get_post('info_url'); + $information_detail = $this->information_model->get_by_url($info_url); + $ic_id = $information_detail->ic_id; + $meta_amp_status = $this->InfoMetas_model->get($ic_id, 'AMP_STATUS'); + if ($meta_amp_status) { + $meta_amp_html = $this->InfoMetas_model->get($ic_id, 'AMP'); + $include_price_html = $this->tags_analysis->replace_price_tag($meta_amp_html); + echo $include_price_html; + } else { + header('HTTP/1.1 404 Not Found'); + header("status: 404 Not Found"); + show_404(); + exit; + } + } + + // http://localhost:8002/guide-use.php/amp_loader/test/?info_url=/yangtzecruise/ + /** + * 测试保存的页面 + */ + public function test() { + $info_url = $this->input->get_post('info_url'); + $information_detail = $this->information_model->get_by_url($info_url); + if (empty($information_detail)) { + echo $info_url.'没有信息类型'; + } + $ic_id = $information_detail->ic_id; + $meta_amp_html = $this->InfoMetas_model->get($ic_id, 'AMP'); + $include_price_html = $this->tags_analysis->replace_price_tag($meta_amp_html); + echo $include_price_html; + } +}