Authored by Rock Zhang

Merge branch 'feature/wap/yuanxiao' into develop/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'])) {
@@ -132,7 +132,8 @@ class YuanxiaoController extends HuodongAction @@ -132,7 +132,8 @@ class YuanxiaoController extends HuodongAction
132 // cookie中存的结果 132 // cookie中存的结果
133 $result = json_decode($result, true); 133 $result = json_decode($result, true);
134 $shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array( 134 $shareUrl = Helpers::url('/cuxiao/yuanxiao/share', array(
135 - 'hash' => $this->encrypt($this->getUid()) 135 + 'hash' => $this->encrypt($this->getUid()),
  136 + 'type' => $this->encrypt($result['type'])
136 )); 137 ));
137 138
138 $this->_view->display('result', array( 139 $this->_view->display('result', array(
@@ -160,6 +161,8 @@ class YuanxiaoController extends HuodongAction @@ -160,6 +161,8 @@ class YuanxiaoController extends HuodongAction
160 if (empty($uid)) { 161 if (empty($uid)) {
161 $this->go(Helpers::url('/cuxiao/yuanxiao/index')); 162 $this->go(Helpers::url('/cuxiao/yuanxiao/index'));
162 } 163 }
  164 + // 抽签结果
  165 + $type = $this->decrypt($this->get('type', ''));
163 166
164 // 调用接口获取type和count 167 // 调用接口获取type和count
165 $result = YuanxiaoModel::getChoujiangShareInfo($uid); 168 $result = YuanxiaoModel::getChoujiangShareInfo($uid);
@@ -169,7 +172,7 @@ class YuanxiaoController extends HuodongAction @@ -169,7 +172,7 @@ class YuanxiaoController extends HuodongAction
169 'staticFile' => self::STATIC_FILE, 172 'staticFile' => self::STATIC_FILE,
170 'result' => array( 173 'result' => array(
171 'name' => $result['name'], 174 'name' => $result['name'],
172 - 'type' => $result['type'] 175 + 'type' => $type ?: $result['type']
173 ), 176 ),
174 'count' => $result['total'], 177 'count' => $result['total'],
175 'staticJS' => array( 178 'staticJS' => array(