Authored by xiaowei

我的逛

@@ -332,15 +332,21 @@ class HomeController extends AbstractAction @@ -332,15 +332,21 @@ class HomeController extends AbstractAction
332 $gender = Helpers::getGenderByCookie(); 332 $gender = Helpers::getGenderByCookie();
333 $yh_channel = Helpers::getChannelByCookie(); 333 $yh_channel = Helpers::getChannelByCookie();
334 $guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit); 334 $guangInfo = \home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
  335 + $totalPage = $guangInfo['totalPage'];
  336 + unset($guangInfo['totalPage']);
335 if ($page == 1) 337 if ($page == 1)
336 { 338 {
337 $this->setTitle('我收藏的'); 339 $this->setTitle('我收藏的');
338 $this->setNavHeader('我收藏的', true, ''); 340 $this->setNavHeader('我收藏的', true, '');
339 $this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true)); 341 $this->_view->display('my-guang', array('myGuangPage' => true, 'myGuang' => array('infos' => $guangInfo), 'pageFooter' => true));
340 } 342 }
341 - else 343 + else if ($page > 1 && $page<=$totalPage)
  344 + {
  345 + $this->_view->display('my-guang-partial', array('infos' => $guangInfo));
  346 + }
  347 + else if ($page > 1 && $page>$totalPage)
342 { 348 {
343 - $this->_view->display('my-guang-partial', array('infos' => $guangInfo)); 349 + echo '';//退出循环
344 } 350 }
345 } 351 }
346 352
@@ -18,6 +18,7 @@ class GuangModel @@ -18,6 +18,7 @@ class GuangModel
18 $result = array(); 18 $result = array();
19 //调用接口获取数据 19 //调用接口获取数据
20 $res = GuangData::getGuangInfo($uid, $page, $yh_channel, $gender, $limit); 20 $res = GuangData::getGuangInfo($uid, $page, $yh_channel, $gender, $limit);
  21 + $result['totalPage']=intval($res['data']['totalPage']);
21 if (!empty($res['data']['data'])) 22 if (!empty($res['data']['data']))
22 { 23 {
23 foreach ($res['data']['data'] as $k => $v) 24 foreach ($res['data']['data'] as $k => $v)