Authored by Rock Zhang

Merge branch 'develop/wap' into beta/wap

@@ -21,16 +21,17 @@ class UserData @@ -21,16 +21,17 @@ class UserData
21 * 个人详情数据 21 * 个人详情数据
22 * 22 *
23 * @param int $uid 用户ID 23 * @param int $uid 用户ID
  24 + * @param int|boolean $cache 缓存时间
24 * @return array 个人详情接口返回的数据 25 * @return array 个人详情接口返回的数据
25 */ 26 */
26 - public static function userData($uid) 27 + public static function userData($uid, $cache = 3600)
27 { 28 {
28 $param = Yohobuy::param(); 29 $param = Yohobuy::param();
29 $param['method'] = 'app.passport.profile'; 30 $param['method'] = 'app.passport.profile';
30 $param['uid'] = $uid; 31 $param['uid'] = $uid;
31 $param['client_secret'] = Sign::getSign($param); 32 $param['client_secret'] = Sign::getSign($param);
32 33
33 - return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时 34 + return Yohobuy::get(Yohobuy::API_URL, $param, $cache); // 缓存1小时
34 } 35 }
35 36
36 /** 37 /**
@@ -30,7 +30,7 @@ class YuanxiaoModel @@ -30,7 +30,7 @@ class YuanxiaoModel
30 ); 30 );
31 31
32 // 调用接口获取个人详情 32 // 调用接口获取个人详情
33 - $userData = UserData::userData($uid); 33 + $userData = UserData::userData($uid, false);
34 34
35 // 处理个人详情数 35 // 处理个人详情数
36 if (isset($userData['data']) && !empty($userData['data'])) { 36 if (isset($userData['data']) && !empty($userData['data'])) {
@@ -133,7 +133,8 @@ class YuanxiaoController extends HuodongAction @@ -133,7 +133,8 @@ class YuanxiaoController extends HuodongAction
133 // cookie中存的结果 133 // cookie中存的结果
134 $result = json_decode($result, true); 134 $result = json_decode($result, true);
135 $shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array( 135 $shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array(
136 - 'hash' => $this->encrypt($this->getUid()) 136 + 'hash' => $this->encrypt($this->getUid()),
  137 + 'type' => $this->encrypt($result['type'])
137 )); 138 ));
138 139
139 $this->_view->display('result', array( 140 $this->_view->display('result', array(
@@ -161,6 +162,8 @@ class YuanxiaoController extends HuodongAction @@ -161,6 +162,8 @@ class YuanxiaoController extends HuodongAction
161 if (empty($uid)) { 162 if (empty($uid)) {
162 $this->go(Helpers::url('/cuxiao/yuanxiao/index')); 163 $this->go(Helpers::url('/cuxiao/yuanxiao/index'));
163 } 164 }
  165 + // 抽签结果
  166 + $type = $this->decrypt($this->get('type', ''));
164 167
165 // 调用接口获取type和count 168 // 调用接口获取type和count
166 $result = YuanxiaoModel::getChoujiangShareInfo($uid); 169 $result = YuanxiaoModel::getChoujiangShareInfo($uid);
@@ -170,7 +173,7 @@ class YuanxiaoController extends HuodongAction @@ -170,7 +173,7 @@ class YuanxiaoController extends HuodongAction
170 'staticFile' => self::STATIC_FILE, 173 'staticFile' => self::STATIC_FILE,
171 'result' => array( 174 'result' => array(
172 'name' => $result['name'], 175 'name' => $result['name'],
173 - 'type' => $result['type'] 176 + 'type' => $type ?: $result['type']
174 ), 177 ),
175 'count' => $result['total'], 178 'count' => $result['total'],
176 'staticJS' => array( 179 'staticJS' => array(