From 4423a77023abc4c7c1e9d4c48f9815c02cb818de Mon Sep 17 00:00:00 2001 From: ycc Date: Wed, 30 Dec 2020 10:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=9A=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E5=88=86=E7=B1=BB=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/information.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/application/controllers/information.php b/application/controllers/information.php index 8a30f117..df957357 100644 --- a/application/controllers/information.php +++ b/application/controllers/information.php @@ -603,6 +603,25 @@ class Information extends CI_Controller return false; } + //生成静态文件 $template='mobile' or 'pc' + function make_www_cache($template,$information){ + $data = array(); + switch ($template){ + case 'mobile': + //获取移动优先的模板,如果有的话 + $mobile_first_template_path = 'mobile_first/' . $this->config->item('site_code'); + if (is_file(APPPATH . 'views/' . $mobile_first_template_path . EXT)) { + $mobile_template = $this->load->view($mobile_first_template_path, '', TRUE); + } else { + return false; + } + break; + case 'pc': + break; + default: + } + } + function make_mobile_html($information) { $data = array(); @@ -784,7 +803,7 @@ class Information extends CI_Controller ); $data['info_hotel'] = $this->Information_model->Detail($random_array[rand(0, count($random_array) - 1)]); if (!empty($data['info_hotel'])) { - $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel_root']->is_path, 1); + $data['info_hotel_root'] = $this->Information_model->get_detail_by_path($data['info_hotel']->is_path, 1); $data['info_hotel']->ic_photo = $this->set_photo_content($data['info_hotel']->ic_photo, $data['info_hotel']->ic_content); } break;