= $iPageTotal) { break; } if ($i == 0) { continue; } $aPageBarNums[] = $i; } array_push($aPageBarNums, end($aPageBarNums) + 1); if ($iPageTotal - ($iPageBarEnd + 1) > 0) { $bHaveMore = true; } else { $bHaveMore = false; } $aData = [ 'barNums' => $aPageBarNums, 'haveMore' => $bHaveMore ]; return $aData; } // public static function argFormat($iPage, $iLimit): array // { // $iDefaultLimit = $limit; // 默认页数,以后是设置 // // $iPage = (int) $request->getQueryParam('p'); // $iLimit = (int) $request->getParam('l'); // // $iPage = $iPage == 0 ? 1 : $iPage; // $iLimit = $iLimit == 0 ? $iDefaultLimit : $iLimit; // // $iOffset = ($iPage - 1) * $iLimit; // // return [ // 'offset' => $iOffset, // 'limit' => $iLimit, // 'page' => $iPage // ]; // } }