IndexController.php
868 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/12/24
* Time: 18:51
*/
namespace app\index\controller;
use app\index\model\PageHtmlModel;
use cmf\controller\WeChatBaseController;
use think\Db;
class IndexController extends WeChatBaseController
{
//授权
function _initialize()
{
//判断用户是否微信浏览器打开
$this->isWechat();
//判断是否手机端
$this->isMobile();
//微信授权
parent::_initialize();
$this->checkWeChatUserLogin();
//阻止拉黑用户
$this->ban();
}
//主页
public function index(){
//首页缩略图
$PageHtmlModel = new PageHtmlModel();
$page_html = $PageHtmlModel->findData(array('id'=>1));
$this->assign('page_html',$page_html);
return $this->fetch();
}
}