123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\index\controller;
- use app\common\controller\Frontend;
- use think\Db;
- class Index extends Frontend
- {
- protected $noNeedLogin = '*';
- protected $noNeedRight = '*';
- protected $layout = '';
- public function index()
- {
- return $this->view->fetch();
- }
- /**
- * 获取网站配置信息
- */
- public function info() {
- $params = $this->request->request("params"); //内容
- $this->view->assign('info',config("site.".$params));
- return $this->view->fetch();
- }
- //邀请页面
- public function invite() {
- $code = input('code', '', 'trim');
- if (!$code) {
- $this->error('邀请码不存在');
- }
- $count = Db::name('user')->where(['invite_no' => $code])->count();
- if (!$count) {
- $this->error('邀请码不存在');
- }
- $is_wechat = strpos($this->request->server('HTTP_USER_AGENT'), 'MicroMessenger') !== false;
- if($is_wechat) {
- $is_wechat = 1;
- } else {
- $is_wechat = 0;
- }
- $this->view->assign('code', $code);
- $this->view->assign('is_wechat', $is_wechat);
- return $this->view->fetch();
- }
- }
|