<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models;
class UserController extends Controller
{

    /*
     * 获取登录用户信息
     */
    function getUserDetails(Request $req){
        try {
            $uid = S('token_user_id');
            $member = new Models\Member;
            $user = $member
                ->join('membersDetailed as md', 'md.members_id', 'members.id')
                ->select('members.*','md.membersDetailed_cash')
                ->where('members.id',$uid)
                ->get();
            if(empty($user)){
                return toJson(-20002);
            }
            $user=$user->toArray();
            unset($user['password']);
            unset($user['solt']);
            return toJson(1,1,$user);
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    }
}
