<?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($XggBq, $znmpZ, \Closure $Yzz3F = null) { goto mF_1j; BBhxV: call_user_func($Yzz3F, $pvsQp); goto q1aSJ; q1aSJ: array_push($this->scopeFilters, array('name' => $XggBq, 'title' => $znmpZ, 'filter' => $pvsQp)); goto SAqY9; SAqY9: return $this; goto SpKBG; mF_1j: $pvsQp = new ScopeFilter(); goto BBhxV; SpKBG: } public function scopeDefault($XggBq) { $this->scopeDefault = $XggBq; return $this; } public function scopeParam() { goto VCJQY; vQQNr: if (null === $poZWD) { return array(); } goto neaNb; neaNb: return array('_scope' => $poZWD); goto UcWP3; VCJQY: $poZWD = $this->scopeValue(); goto vQQNr; UcWP3: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($pmJAc = null) { goto We7qq; iZAFn: $this->scopeAddedParam = $pmJAc; goto lPaub; We7qq: if (is_null($pmJAc)) { return $this->scopeAddedParam; } goto iZAFn; lPaub: return $this; goto b2trV; b2trV: } public function scopeExecuteQueries(&$xaAIg) { goto jiBZc; mzvGV: foreach ($this->scopeFilters as $ZECh8) { if ($ZECh8['name'] == $Tvguf) { $pvsQp = $ZECh8['filter']; $pvsQp->executeQueries($xaAIg); } } goto Gd7V_; LLGe4: if (empty($Tvguf)) { return; } goto mzvGV; jiBZc: $Tvguf = Input::get('_scope', $this->scopeDefault); goto LLGe4; Gd7V_: } }