<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PaginateUtil { public static function pack($J2nWJ, $S_qaA, $tWfiU) { goto klQ_S; Ut7Vp: $pTwJr['pageSize'] = $tWfiU; goto WVhzA; tgtzR: return $pTwJr; goto HjC3b; tGLEK: $K0yTv = $tWfiU * ($S_qaA - 1); goto lAbGc; klQ_S: $pTwJr = array(); goto cm8lW; cm8lW: $pTwJr['page'] = $S_qaA; goto Ut7Vp; WVhzA: $pTwJr['total'] = count($J2nWJ); goto tGLEK; lAbGc: if ($K0yTv < 0 || $K0yTv >= count($J2nWJ)) { $pTwJr['records'] = array(); } else { $pTwJr['records'] = array_slice($J2nWJ, $K0yTv, $tWfiU); } goto tgtzR; HjC3b: } public static function pack1($J2nWJ) { goto rBZoM; SwNqN: return $pTwJr; goto U_rG0; ZSi2b: $pTwJr['page'] = 1; goto XS9WF; rBZoM: $pTwJr = array(); goto ZSi2b; kLEUE: $pTwJr['records'] = $J2nWJ; goto SwNqN; HA7kO: $pTwJr['total'] = count($J2nWJ); goto kLEUE; XS9WF: $pTwJr['pageSize'] = count($J2nWJ); goto HA7kO; U_rG0: } }