<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Partner\Util; use Illuminate\Support\Facades\Cache; use ModStart\Core\Assets\AssetsUtil; use ModStart\Core\Dao\ModelUtil; use Module\Partner\Type\PartnerPosition; class PartnerUtil { const CACHE_KEY_PREFIX = 'partner:'; public static function listByPosition($zeOUe = 'home') { goto NFCFW; hJCg5: foreach ($MCyeh as $KAKiA => $Iim2u) { if (!empty($Iim2u['logo'])) { $MCyeh[$KAKiA]['logo'] = AssetsUtil::fixFull($Iim2u['logo']); } } goto STZiS; STZiS: return $MCyeh; goto TRa2K; NFCFW: $MCyeh = ModelUtil::model('partner')->where(array('position' => $zeOUe, 'enable' => true))->orderBy('sort', 'asc')->get()->toArray(); goto hJCg5; TRa2K: } public static function listByPositionWithCache($zeOUe = 'home', $Vr9BY = 60) { return Cache::remember(self::CACHE_KEY_PREFIX . $zeOUe, $Vr9BY, function () use($zeOUe) { return self::listByPosition($zeOUe); }); } public static function clearCache() { foreach (PartnerPosition::getList() as $KAKiA => $NMB1l) { Cache::forget(self::CACHE_KEY_PREFIX . $KAKiA); } } }