<?php
namespace Passport\Src;

use Dever;
use Passport\Lib\Base;

class Api
{
    private $user;

    public function info($uid)
    {
        $info = Dever::db('passport/user')->one($uid);
        if ($info) {
        	$info['name'] = '';
        	if ($info['truename']) {
	        	$info['name'] = $info['truename'];
	        } elseif ($info['username']) {
	        	$info['name'] = $info['username'];
	        }

            if ($info['area']) {
                $info['add'] = $info['name'] . '('.$info['area'].')';
            } else {
                $info['add'] = $info['name'] . '(未知)';
            }
        }
        
        return $info;
    }

    # 测试合并
    public function test_combine()
    {
        $base = new Base;
        $base->combine(3, 321313);
    }
}
