<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Partner\Util; use Illuminate\Support\Facades\Cache; use ModStart\Core\Dao\ModelUtil; use Module\Partner\Type\PartnerPosition; class PartnerUtil { const CACHE_KEY_PREFIX = 'partner:'; public static function listByPosition($qMgyC = 'home') { return ModelUtil::model('partner')->where(array('position' => $qMgyC))->orderBy('sort', 'asc')->get()->toArray(); } public static function listByPositionWithCache($qMgyC = 'home', $aTEKz = 60) { return Cache::remember(self::CACHE_KEY_PREFIX . $qMgyC, $aTEKz, function () use($qMgyC) { return self::listByPosition($qMgyC); }); } public static function clearCache() { foreach (PartnerPosition::getList() as $l0ek5 => $zYJ1g) { Cache::forget(self::CACHE_KEY_PREFIX . $l0ek5); } } }