<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\CmsHelp\Util; use Illuminate\Support\Facades\Cache; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\TreeUtil; class CmsHelpCategoryUtil { public static function clearCache() { Cache::forget('cmsHelpCategory'); Cache::forget('cmsHelpCategoryTree'); } public static function all() { return Cache::remember('cmsHelpCategory', 3600, function () { return ModelUtil::all('cms_help_category', array(), array('*'), array('sort', 'asc')); }); } public static function tree() { return Cache::remember('cmsHelpCategoryTree', 3600, function () { return TreeUtil::modelToTree('cms_help_category', array('name')); }); } public static function get($MkmbZ) { return ModelUtil::get('cms_help_category', $MkmbZ); } public static function chain($MkmbZ) { $Z1XeS = self::all(); return TreeUtil::nodesChain($Z1XeS, $MkmbZ); } }