Yuanxiao.php 957 Bytes
<?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;
    }
}