<?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($sQIr6, $g3XgV, \Closure $SO11l = null) { goto vsgFH; cF6Q5: return $this; goto vwhmh; GIXqm: array_push($this->scopeFilters, array('name' => $sQIr6, 'title' => $g3XgV, 'filter' => $z8oGH)); goto cF6Q5; aAs04: call_user_func($SO11l, $z8oGH); goto GIXqm; vsgFH: $z8oGH = new ScopeFilter(); goto aAs04; vwhmh: } public function scopeDefault($sQIr6) { $this->scopeDefault = $sQIr6; return $this; } public function scopeParam() { goto lFwQV; t6S9k: return array('_scope' => $mOh4i); goto uJpcz; lFwQV: $mOh4i = $this->scopeValue(); goto LP4wC; LP4wC: if (null === $mOh4i) { return array(); } goto t6S9k; uJpcz: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($qHLCM = null) { goto YHZp4; YHZp4: if (is_null($qHLCM)) { return $this->scopeAddedParam; } goto ymmWt; akuH4: return $this; goto QUcrs; ymmWt: $this->scopeAddedParam = $qHLCM; goto akuH4; QUcrs: } public function scopeExecuteQueries(&$sFfhd) { goto UcZNw; lvBdT: if (empty($j5svu)) { return; } goto vr3fh; vr3fh: foreach ($this->scopeFilters as $tTCIW) { if ($tTCIW['name'] == $j5svu) { $z8oGH = $tTCIW['filter']; $z8oGH->executeQueries($sFfhd); } } goto Uwkwk; UcZNw: $j5svu = Input::get('_scope', $this->scopeDefault); goto lvBdT; Uwkwk: } }