Authored by Rock Zhang

添加获取用户详情是否添加缓存的配置参数

Code Review By Rock Zhang
... ... @@ -21,16 +21,17 @@ class UserData
* 个人详情数据
*
* @param int $uid 用户ID
* @param int|boolean $cache 缓存时间
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
public static function userData($uid, $cache = 3600)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.profile';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时
return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 缓存1小时
}
/**
... ...
... ... @@ -30,7 +30,7 @@ class YuanxiaoModel
);
// 调用接口获取个人详情
$userData = UserData::userData($uid);
$userData = UserData::userData($uid, false);
// 处理个人详情数
if (isset($userData['data']) && !empty($userData['data'])) {
... ...