UserController.php
826 字节
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
39
40
41
42
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/12
* Time: 11:24
*/
namespace app\index\controller;
use cmf\controller\WeChatBaseController;
use think\Db;
class UserController extends WeChatBaseController
{
function _initialize()
{
parent::_initialize();
$this->checkWeChatUserLogin();
}
public function index()
{
$user_id = cmf_get_current_user_id();
$data = Db::name('integral')
->where('user_id',$user_id)
->find()
->toArray();
if(empty($data)){
return $this->fetch();
}else{
$this->assign('data',$data);
return $this->fetch();
}
}
//注册(绑定手机号)
public function login()
{
return $this->fetch();
}
}