Merge branch 'hotfix/apichange-bug' into develop
Code Review By Rock Zhang
Showing
3 changed files
with
16 additions
and
13 deletions
@@ -99,6 +99,7 @@ class NewsaleData | @@ -99,6 +99,7 @@ class NewsaleData | ||
99 | $param['method'] = 'app.search.newProduct'; | 99 | $param['method'] = 'app.search.newProduct'; |
100 | } else { | 100 | } else { |
101 | $param['method'] = 'app.search.sales'; | 101 | $param['method'] = 'app.search.sales'; |
102 | + $param['p_d'] = '0.1,0.9'; | ||
102 | } | 103 | } |
103 | $param['page'] = $page; | 104 | $param['page'] = $page; |
104 | $param['limit'] = $limit; | 105 | $param['limit'] = $limit; |
@@ -462,12 +462,18 @@ class HomeController extends AbstractAction | @@ -462,12 +462,18 @@ class HomeController extends AbstractAction | ||
462 | */ | 462 | */ |
463 | public function onlineServiceDetailAction() | 463 | public function onlineServiceDetailAction() |
464 | { | 464 | { |
465 | - $service = array(); | 465 | + $service = array(); |
466 | $cateId = $this->get('cateId', 0); | 466 | $cateId = $this->get('cateId', 0); |
467 | $cateName = $this->get('cateName', ''); | 467 | $cateName = $this->get('cateName', ''); |
468 | if ($cateId > 0) { | 468 | if ($cateId > 0) { |
469 | $service = Home\OnlineModel::getOnlineServiceDetail($cateId); | 469 | $service = Home\OnlineModel::getOnlineServiceDetail($cateId); |
470 | } | 470 | } |
471 | + | ||
472 | + $service = array( | ||
473 | + 'header' => array('title' => '在线客服'), | ||
474 | + 'service' => $service | ||
475 | + ); | ||
476 | + | ||
471 | $this->setTitle('在线客服'); | 477 | $this->setTitle('在线客服'); |
472 | $this->setNavHeader($cateName, true, ''); | 478 | $this->setNavHeader($cateName, true, ''); |
473 | $this->_view->display('online-service-detail', $service); | 479 | $this->_view->display('online-service-detail', $service); |
@@ -70,21 +70,17 @@ class OnlineModel | @@ -70,21 +70,17 @@ class OnlineModel | ||
70 | return $result; | 70 | return $result; |
71 | } | 71 | } |
72 | $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); | 72 | $res = OnlineData::getOnlineServiceDetail($cateId, $clinetType); |
73 | - $questionInfo = $res['data']; | ||
74 | - if ($questionInfo) { | 73 | + if (isset($res['code']) && $res['code'] === 200) { |
74 | + $questionInfo = $res['data']; | ||
75 | $list = array(); | 75 | $list = array(); |
76 | - if ($questionInfo) { | ||
77 | - foreach ($questionInfo as $qk => $qv) { | ||
78 | - $list[$qk]['q'] = $qv['title']; | ||
79 | - $list[$qk]['a'] = $qv['content']; | ||
80 | - } | 76 | + foreach ($questionInfo as $qk => $qv) { |
77 | + $list[$qk]['q'] = $qv['title']; | ||
78 | + $list[$qk]['a'] = $qv['content']; | ||
81 | } | 79 | } |
82 | - //处理返回信息 | ||
83 | - $result = array( | ||
84 | - 'header' => array('title' => '在线客服'), | ||
85 | - 'list' => $list | ||
86 | - ); | 80 | + |
81 | + !empty($list) && $result['list'] = $list; | ||
87 | } | 82 | } |
83 | + | ||
88 | return $result; | 84 | return $result; |
89 | } | 85 | } |
90 | 86 |
-
Please register or login to post a comment