Skip to content

Commit 380a974

Browse files
author
Ethan
committed
pageSize
1 parent ec1f246 commit 380a974

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Pagination.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ protected function appendSuffix($url)
219219
public function jsonSerialize()
220220
{
221221
return array(
222-
'itemCount' => $this->itemCount,//总记录数
223-
'currentPage' => $this->currentPage,//当前页码
224-
'offset' => $this->offset, //数据库查询的偏移量(查询开始的记录)
225-
'pageSize' => $this->pageSize,//每页显示记录数
226-
'pageCount' => $this->pageCount,//总页数
227-
'prevPage' => $this->prevPage,//当前的上一页码
228-
'nextPage' => $this->nextPage,//当前的下一页码
222+
'itemCount' => intval($this->itemCount),//总记录数
223+
'currentPage' => intval($this->currentPage),//当前页码
224+
'offset' => intval($this->offset), //数据库查询的偏移量(查询开始的记录)
225+
'pageSize' => intval($this->pageSize),//每页显示记录数
226+
'pageCount' => intval($this->pageCount),//总页数
227+
'prevPage' => intval($this->prevPage),//当前的上一页码
228+
'nextPage' => intval($this->nextPage),//当前的下一页码
229229
);
230230
}
231231

@@ -234,7 +234,7 @@ public function __get($name)
234234
$this->init();
235235
switch ($name) {
236236
case 'limit':
237-
return $this->offset . ', ' . $this->pageSize;
237+
return intval($this->offset) . ', ' . intval($this->pageSize);
238238
default:
239239
return $this->$name;
240240
}

0 commit comments

Comments
 (0)