<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\TreeUtil; class FilterUtil { private static function categoryGet($YuOBD, $ULYbu) { foreach ($YuOBD as $WDJxG) { if ($WDJxG['id'] == $ULYbu) { return $WDJxG; } } return null; } public static function categoryTreeFilter($tKN9l, $YuOBD, $Y0jHe = 'title', $XDfIv = 'pid') { goto kajRW; YkBRk: $WDJxG = null; goto jX1sd; GeQuF: $c_KSv = array($tKN9l); goto Dqqzo; kajRW: $xkjPt = array(); goto w24nB; w24nB: $dhknk = array(); goto YkBRk; QJma7: $c_KSv = array_merge($c_KSv, $FzwFH); goto Laa5l; Dqqzo: $FzwFH = TreeUtil::nodesChildrenIds($YuOBD, $tKN9l); goto QJma7; jX1sd: if ($tKN9l) { goto zIhqr; BT1Y0: $dhknk[] = $WDJxG[$Y0jHe]; goto iIKcy; iIKcy: if ($WDJxG[$XDfIv]) { $GtwRQ = self::categoryGet($YuOBD, $WDJxG[$XDfIv]); $dhknk[] = $GtwRQ[$Y0jHe]; } goto DUH2O; zIhqr: $WDJxG = self::categoryGet($YuOBD, $tKN9l); goto z_SGw; z_SGw: BizException::throwsIfEmpty('分类不存在', $WDJxG); goto fM9JT; fM9JT: $xkjPt[] = $WDJxG[$Y0jHe]; goto BT1Y0; DUH2O: } goto GeQuF; winWd: return array($WDJxG, $c_KSv, $srzqP, $xkjPt, $dhknk); goto HrzZ7; Laa5l: $srzqP = TreeUtil::nodesChainWithItems($YuOBD, $tKN9l); goto winWd; HrzZ7: } }