Authored by Rock Zhang

修复用户等级,用户个人信息接口处理的问题

@@ -19,7 +19,7 @@ class GradeData @@ -19,7 +19,7 @@ class GradeData
19 * @param string $uid 用户id 19 * @param string $uid 用户id
20 * @return array 接口返回的会员等级数据 20 * @return array 接口返回的会员等级数据
21 */ 21 */
22 - public function getGradeData($gender, $channel, $uid) { 22 + public static function getGradeData($gender, $channel, $uid) {
23 $urlList = array(); 23 $urlList = array();
24 //获取会员等级数据 24 //获取会员等级数据
25 $param = Yohobuy::param(); 25 $param = Yohobuy::param();
@@ -403,19 +403,19 @@ class HomeController extends AbstractAction @@ -403,19 +403,19 @@ class HomeController extends AbstractAction
403 * 意见反馈 403 * 意见反馈
404 */ 404 */
405 public function suggestAction() { 405 public function suggestAction() {
  406 + // 设置网站标题
  407 + $this->setTitle('意见反馈');
  408 + $this->setNavHeader('意见反馈', true, SITE_MAIN);
  409 +
406 $udid = $this->getUdid(); 410 $udid = $this->getUdid();
407 $page = $this->get('page', 1); 411 $page = $this->get('page', 1);
408 $limit = $this->get('limit', 30); 412 $limit = $this->get('limit', 30);
409 413
410 $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit); 414 $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
411 415
412 - //print_r($suggest); 416 + print_r($suggest);
413 $this->_view->display('suggest', array( 417 $this->_view->display('suggest', array(
414 'suggestPage' => true, //加载js 418 'suggestPage' => true, //加载js
415 - 'pageHeader' => array(  
416 - 'navBack' => true,  
417 - 'navTitle' => '意见反馈'  
418 - ),  
419 'pageFooter' => true, 419 'pageFooter' => true,
420 'suggest' => true, 420 'suggest' => true,
421 'suggestContent' => array( 421 'suggestContent' => array(
@@ -15,7 +15,7 @@ class GradeModel @@ -15,7 +15,7 @@ class GradeModel
15 * 获取个人中心-会员等级数据 15 * 获取个人中心-会员等级数据
16 */ 16 */
17 17
18 - public function getGrade($gender, $channel, $uid) { 18 + public static function getGrade($gender, $channel, $uid) {
19 $result = array(); 19 $result = array();
20 20
21 if (USE_CACHE) { 21 if (USE_CACHE) {
@@ -27,6 +27,8 @@ class GradeModel @@ -27,6 +27,8 @@ class GradeModel
27 } 27 }
28 //调用接口获取数据 28 //调用接口获取数据
29 $data = GradeData::getGradeData($gender, $channel, $uid); 29 $data = GradeData::getGradeData($gender, $channel, $uid);
  30 +
  31 + if (!empty($data['grade'])) {
30 switch (intval($data['grade']['current_vip_level'])) { 32 switch (intval($data['grade']['current_vip_level'])) {
31 case 0://普通会员 33 case 0://普通会员
32 $result['vipGrade']['vip0'] = true; 34 $result['vipGrade']['vip0'] = true;
@@ -60,7 +62,7 @@ class GradeModel @@ -60,7 +62,7 @@ class GradeModel
60 $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null); 62 $result['vipGrade']['allUrl'] = Helpers::url('/Home/preferential', null);
61 //当前vip等级享受的特权 63 //当前vip等级享受的特权
62 $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential']; 64 $result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
63 - 65 + }
64 66
65 if (USE_CACHE) { 67 if (USE_CACHE) {
66 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据. 68 // 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
@@ -33,6 +33,7 @@ class UserModel @@ -33,6 +33,7 @@ class UserModel
33 // 处理个人详情数据 33 // 处理个人详情数据
34 if (isset($userData['data']) && !empty($userData['data'])) { 34 if (isset($userData['data']) && !empty($userData['data'])) {
35 $result = $userData['data']; 35 $result = $userData['data'];
  36 + $result['gender'] = $result['gender'] == 1 ? '男' : '女';
36 $result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128); 37 $result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128);
37 } 38 }
38 39
@@ -349,7 +350,20 @@ class UserModel @@ -349,7 +350,20 @@ class UserModel
349 350
350 // 处理意见反馈数据 351 // 处理意见反馈数据
351 if (isset($suggest['data']) && !empty($suggest['data'])) { 352 if (isset($suggest['data']) && !empty($suggest['data'])) {
352 - $result = $suggest['data']; 353 + $one = array();
  354 + foreach ($suggest['data']['list'] as $val) {
  355 + $one = array();
  356 + $one['hasImage'] = $val['has_image'];
  357 + $one['imgUrl'] = Helpers::getImageUrl($val['cover_image'], 640, 240);
  358 + $one['title'] = $val['filter_content'];
  359 + $one['content'] = $val['reply_content'];
  360 + $one['good'] = $val['is_reliable'];
  361 + $one['bad'] = !$val['is_reliable'];
  362 + $one['goodNum'] = $val['reliable'];
  363 + $one['badNum'] = $val['unreliable'];
  364 +
  365 + $result[] = $one;
  366 + }
353 } 367 }
354 368
355 return $result; 369 return $result;