<?php
namespace app\index\controller;
use app\index\controller\Common;
use app\service\CustomViewService;
use app\service\SeoService;
* 自定义页面
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
class CustomView extends Common
{
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
}
* 详情
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-06T21:31:53+0800
*/
public function Index()
{
if(!empty($this->data_request['id']))
{
$id = intval($this->data_request['id']);
$params = [
'where' => [
['is_enable', '=', 1],
['id', '=', $id],
],
'm' => 0,
'n' => 1,
];
$ret = CustomViewService::CustomViewList($params);
if(!empty($ret['data']) && !empty($ret['data'][0]))
{
$data = $ret['data'][0];
CustomViewService::CustomViewAccessCountInc(['id'=>$data['id']]);
$assign = [
'data' => $data,
'is_header' => $data['is_header'],
'is_footer' => $data['is_footer'],
];
$seo_title = empty($data['seo_title']) ? $data['name'] : $data['seo_title'];
$assign['home_seo_site_title'] = SeoService::BrowserSeoTitle($seo_title, 2);
if(!empty($data['seo_keywords']))
{
$assign['home_seo_site_keywords'] = $data['seo_keywords'];
}
if(!empty($data['seo_desc']))
{
$assign['home_seo_site_description'] = $data['seo_desc'];
}
MyViewAssign($assign);
return MyView();
}
}
MyViewAssign('msg', MyLang('customview.custom_view_no_data_tips'));
return MyView('public/tips_error');
}
}
?>