<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\TreeUtil; class FilterUtil { private static function categoryGet($ztmom, $DcXJr) { foreach ($ztmom as $ar_Ag) { if ($ar_Ag['id'] == $DcXJr) { return $ar_Ag; } } return null; } public static function categoryTreeFilter($gf2oi, $ztmom, $YK_db = 'title', $VIham = 'pid') { goto a2hYt; ZZRxA: $Ut6kc = array($gf2oi); goto wJV5j; SqmkJ: $ar_Ag = null; goto oPtWB; a2hYt: $iaxX8 = array(); goto yQXSq; TyPf0: return array($ar_Ag, $Ut6kc, $o9HKq, $iaxX8, $GZP1b); goto pB3Ox; yQXSq: $GZP1b = array(); goto SqmkJ; tLSUU: $Ut6kc = array_merge($Ut6kc, $bd2hV); goto TIPs8; oPtWB: if ($gf2oi) { goto V_8VV; rmJsM: $iaxX8[] = $ar_Ag[$YK_db]; goto AIAMq; mCV35: BizException::throwsIfEmpty('分类不存在', $ar_Ag); goto rmJsM; AIAMq: $GZP1b[] = $ar_Ag[$YK_db]; goto KyxAW; KyxAW: if ($ar_Ag[$VIham]) { $D1vCs = self::categoryGet($ztmom, $ar_Ag[$VIham]); $GZP1b[] = $D1vCs[$YK_db]; } goto wts6I; V_8VV: $ar_Ag = self::categoryGet($ztmom, $gf2oi); goto mCV35; wts6I: } goto ZZRxA; TIPs8: $o9HKq = TreeUtil::nodesChainWithItems($ztmom, $gf2oi); goto TyPf0; wJV5j: $bd2hV = TreeUtil::nodesChildrenIds($ztmom, $gf2oi); goto tLSUU; pB3Ox: } }