Authored by weiqingting

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -46,20 +46,20 @@ class CommonController extends WebAction @@ -46,20 +46,20 @@ class CommonController extends WebAction
46 HomeModel::COOKIE_NAME_LIFESTYLE 46 HomeModel::COOKIE_NAME_LIFESTYLE
47 ); 47 );
48 $channel = $this->post('type', ''); 48 $channel = $this->post('type', '');
49 - $pageIndex = intval($this->post('pageIndex', 1)); 49 + $pageIndex = intval($this->post('pageIndex', 0));
50 $pageCount = intval($this->post('pageCount', 8)); 50 $pageCount = intval($this->post('pageCount', 8));
51 if (! in_array($channel, $channels)) { 51 if (! in_array($channel, $channels)) {
52 break; 52 break;
53 } else { 53 } else {
54 $data = HomeModel::getNewArrival($channel); 54 $data = HomeModel::getNewArrival($channel);
55 } 55 }
56 - if($pageIndex < 1) {  
57 - $pageIndex = 1; 56 + if($pageIndex < 0) {
  57 + $pageIndex = 0;
58 } 58 }
59 - if($pageCount < 1 || $pageCount > 50) { 59 + if($pageCount < 0 || $pageCount > 50) {
60 $pageCount = 20; 60 $pageCount = 20;
61 } 61 }
62 - $result = array_slice($data, $pageIndex - 1, $pageCount); 62 + $result = array_slice($data, $pageIndex, $pageCount);
63 if (empty($result)) { 63 if (empty($result)) {
64 break; 64 break;
65 } 65 }