fix some problems

This commit is contained in:
cano
2024-03-03 10:15:50 +08:00
parent 1c555934d1
commit f4f61a5f4c
3 changed files with 64 additions and 28 deletions

View File

@ -5,7 +5,7 @@ namespace App\Tools;
class CollectOffsetLimit
{
private $offset = 0;
private $limit = 2000;
private $limit = 1000;
private $page = 0;
private $iTotalCount = null;
@ -34,7 +34,7 @@ class CollectOffsetLimit
{
$this->countPage();
if($this->iTotalCount === null) $this->iTotalCount = $this->fCountFun;
if($this->iTotalCount === 0 | $this->page === 0) return [];
if($this->iTotalCount === 0 || $this->page === 0) return [];
for( $iPage = 1; $iPage <= $this->page; $iPage++){
$this->offset = ($iPage - 1) * $this->limit;
$fun($this->offset,$this->limit);