浏览代码

Merge pull request #1555 from SmallRuralDog/patch-1

修复MongoDB 分页perPage错误
Jiang Qinghua 3 年之前
父节点
当前提交
9fa2d2d110
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/Grid/Model.php

+ 6 - 1
src/Grid/Model.php

@@ -535,7 +535,12 @@ class Model
             return;
         }
 
-        return $this->request->get($this->getPerPageName()) ?: $this->perPage;
+        $perPage = $this->request->get($this->getPerPageName()) ?: $this->perPage;
+        if ($perPage) {
+            return (int) $perPage;
+        }
+
+        return null;
     }
 
     /**