<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Repository\Filter; use Illuminate\Support\Facades\Input; trait HasScopeFilter { protected $scopeFilters = array(); protected $scopeDefault = null; protected $scopeAddedParam = array(); public function scopeFilter($c6VKG, $sVLvF, \Closure $yeJzO = null) { goto CNe1D; H1u7x: return $this; goto xMhU2; PDM5K: call_user_func($yeJzO, $geg6A); goto XJllx; XJllx: array_push($this->scopeFilters, array('name' => $c6VKG, 'title' => $sVLvF, 'filter' => $geg6A)); goto H1u7x; CNe1D: $geg6A = new ScopeFilter(); goto PDM5K; xMhU2: } public function scopeDefault($c6VKG) { $this->scopeDefault = $c6VKG; return $this; } public function scopeParam() { goto kjnxf; kjnxf: $kENRA = $this->scopeValue(); goto qElgl; wmxc2: return array('_scope' => $kENRA); goto l5JQE; qElgl: if (null === $kENRA) { return array(); } goto wmxc2; l5JQE: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($pFM9U = null) { goto u4Ftq; jos7O: return $this; goto WJxNL; QhAwh: $this->scopeAddedParam = $pFM9U; goto jos7O; u4Ftq: if (is_null($pFM9U)) { return $this->scopeAddedParam; } goto QhAwh; WJxNL: } public function scopeExecuteQueries(&$qeoqS) { goto YByIM; YByIM: $bLGF7 = Input::get('_scope', $this->scopeDefault); goto Ffudp; B15U1: foreach ($this->scopeFilters as $xuZmc) { if ($xuZmc['name'] == $bLGF7) { $geg6A = $xuZmc['filter']; $geg6A->executeQueries($qeoqS); } } goto esiXj; Ffudp: if (empty($bLGF7)) { return; } goto B15U1; esiXj: } }