Support array for limit method in model

This commit is contained in:
lichengyin 2016-05-05 16:00:48 +08:00
parent e9ab397d2d
commit 81828214a8

View File

@ -184,6 +184,10 @@ export default class extends think.base {
if (offset === undefined) {
return this;
}
if(think.isArray(offset)){
length = offset[1] || length;
offset = offset[0];
}
offset = Math.max(parseInt(offset) || 0, 0);
if(length){
length = Math.max(parseInt(length) || 0, 0);