<?php

namespace app\api\service;

use app\api\validate\UserValidate;
use app\model\project\User as userModel;
use app\Request;

class UserService
{

    public static function  getUserInfo($token)
    {

        $user = TokenService::verifyToken($token);
        if ($user===false)
        {
            return false;
        }

        $user = userModel::where(['token'=>$token])
            ->field('id,username,mobile,realname,token,role')
//            ->with(['getSchoolData','getBusinessData'=>['businessQualification']])
            ->find();
        if (!$user)
        {
            return false;
        }

        return $user->toArray();
    }


}