support set an array to page method

This commit is contained in:
lichengyin 2015-10-25 21:46:38 +08:00
parent 703f9c8117
commit 420b5d4f17

View File

@ -191,6 +191,10 @@ export default class extends think.base {
if (page === undefined) {
return this;
}
if(think.isArray(page)){
listRows = page[1] || listRows;
page = page[0];
}
page = parseInt(page) || 1;
this._options.limit = [listRows * (page - 1), listRows];
return this;