Authored by Rock Zhang

Merge branch 'feature/wap/yuanxiao' into develop/wap

... ... @@ -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'])) {
... ...
... ... @@ -132,7 +132,8 @@ class YuanxiaoController extends HuodongAction
// cookie中存的结果
$result = json_decode($result, true);
$shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array(
'hash' => $this->encrypt($this->getUid())
'hash' => $this->encrypt($this->getUid()),
'type' => $this->encrypt($result['type'])
));
$this->_view->display('result', array(
... ... @@ -160,6 +161,8 @@ class YuanxiaoController extends HuodongAction
if (empty($uid)) {
$this->go(Helpers::url('/cuxiao/yuanxiao/index'));
}
// 抽签结果
$type = $this->decrypt($this->get('type', ''));
// 调用接口获取type和count
$result = YuanxiaoModel::getChoujiangShareInfo($uid);
... ... @@ -169,7 +172,7 @@ class YuanxiaoController extends HuodongAction
'staticFile' => self::STATIC_FILE,
'result' => array(
'name' => $result['name'],
'type' => $result['type']
'type' => $type ?: $result['type']
),
'count' => $result['total'],
'staticJS' => array(
... ...