Authored by whb

最新上架修改参数

... ... @@ -46,20 +46,20 @@ class CommonController extends WebAction
HomeModel::COOKIE_NAME_LIFESTYLE
);
$channel = $this->post('type', '');
$pageIndex = intval($this->post('pageIndex', 1));
$pageIndex = intval($this->post('pageIndex', 0));
$pageCount = intval($this->post('pageCount', 8));
if (! in_array($channel, $channels)) {
break;
} else {
$data = HomeModel::getNewArrival($channel);
}
if($pageIndex < 1) {
$pageIndex = 1;
if($pageIndex < 0) {
$pageIndex = 0;
}
if($pageCount < 1 || $pageCount > 50) {
if($pageCount < 0 || $pageCount > 50) {
$pageCount = 20;
}
$result = array_slice($data, $pageIndex - 1, $pageCount);
$result = array_slice($data, $pageIndex, $pageCount);
if (empty($result)) {
break;
}
... ...