<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Util; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\TreeUtil; class FilterUtil { private static function categoryGet($Uet5A, $StE5h) { foreach ($Uet5A as $zmsn6) { if ($zmsn6['id'] == $StE5h) { return $zmsn6; } } return null; } public static function categoryTreeFilter($QgB_Y, $Uet5A, $p8m7o = 'title', $hUt4C = 'pid') { goto eTvZE; KgMG1: $zmsn6 = null; goto gLx7o; eTvZE: $bpAvD = array(); goto ipTM8; gLx7o: if ($QgB_Y) { goto ht3Ie; hJEtk: $l2OFZ[] = $zmsn6[$p8m7o]; goto kSQ53; kSQ53: if ($zmsn6[$hUt4C]) { $kiwmv = self::categoryGet($Uet5A, $zmsn6[$hUt4C]); $l2OFZ[] = $kiwmv[$p8m7o]; } goto Lfo7b; EtOuu: $bpAvD[] = $zmsn6[$p8m7o]; goto hJEtk; DnXdz: BizException::throwsIfEmpty('分类不存在', $zmsn6); goto EtOuu; ht3Ie: $zmsn6 = self::categoryGet($Uet5A, $QgB_Y); goto DnXdz; Lfo7b: } goto sTYJG; HBmhG: $Fm0EO = array_merge($Fm0EO, $RabcZ); goto eRyn6; sxNao: $RabcZ = TreeUtil::nodesChildrenIds($Uet5A, $QgB_Y); goto HBmhG; ipTM8: $l2OFZ = array(); goto KgMG1; sTYJG: $Fm0EO = array($QgB_Y); goto sxNao; Pb8Tk: return array($zmsn6, $Fm0EO, $xKrFv, $bpAvD, $l2OFZ); goto suWxi; eRyn6: $xKrFv = TreeUtil::nodesChainWithItems($Uet5A, $QgB_Y); goto Pb8Tk; suWxi: } }