<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Photo\Util; use Illuminate\Support\Facades\Cache; use ModStart\Core\Dao\ModelUtil; class PhotoCategoryUtil { const PREFIX = 'PhotoCategory:'; public static function clearCache() { Cache::forget(self::PREFIX . 'All'); } public static function listCategories() { return Cache::rememberForever(self::PREFIX . 'All', function () { return ModelUtil::model('photo_category')->orderBy('sort', 'asc')->get(array('id', 'cover', 'name', 'photoCount', 'visitType', 'type'))->toArray(); }); } public static function get($DcXJr) { return ModelUtil::get('photo_category', $DcXJr); } }