Yuanxiao.php
957 Bytes
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
namespace Cuxiao;
use LibModels\Wap\Home\UserData;
/**
* Created by PhpStorm.
* User: Gtskk
* Date: 2016/2/18
* Time: 16:26
*
* @name YuanxiaoModel
* @package models/Cuxiao
* @author Gtskk(tttt6399998@126.com)
*/
class YuanxiaoModel
{
/**
* 处理用户详情数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserProfileData($uid)
{
$result = array(
'birthday' => '2000-01-01',
'gender' => 0
);
// 调用接口获取个人详情
$userData = UserData::userData($uid);
// 处理个人详情数
if (isset($userData['data']) && !empty($userData['data'])) {
$result['birthday'] = $userData['data']['birthday'] ?: '2000-01-01';
$result['gender'] = $userData['data']['gender'] == 1 ? '男' : '女';
}
return $result;
}
}