UserController.php 826 字节
<?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();
    }

}