<?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($f0dxO, $Cq64_, \Closure $uTSeU = null) { goto SwI73; SwI73: $XYn5i = new ScopeFilter(); goto Luy6b; mT8pU: array_push($this->scopeFilters, array('name' => $f0dxO, 'title' => $Cq64_, 'filter' => $XYn5i)); goto pomI0; pomI0: return $this; goto i5_vS; Luy6b: call_user_func($uTSeU, $XYn5i); goto mT8pU; i5_vS: } public function scopeDefault($f0dxO) { $this->scopeDefault = $f0dxO; return $this; } public function scopeParam() { goto HKg1J; Ppz7g: if (null === $M8lGK) { return array(); } goto A_oFi; A_oFi: return array('_scope' => $M8lGK); goto D61BI; HKg1J: $M8lGK = $this->scopeValue(); goto Ppz7g; D61BI: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($AXgEz = null) { goto g51S7; g51S7: if (is_null($AXgEz)) { return $this->scopeAddedParam; } goto k3BuZ; k3BuZ: $this->scopeAddedParam = $AXgEz; goto b1nM2; b1nM2: return $this; goto fwO5w; fwO5w: } public function scopeExecuteQueries(&$vw3jY) { goto qCQ3U; Tg30W: foreach ($this->scopeFilters as $UCzt3) { if ($UCzt3['name'] == $y28z9) { $XYn5i = $UCzt3['filter']; $XYn5i->executeQueries($vw3jY); } } goto TN1Zw; qCQ3U: $y28z9 = Input::get('_scope', $this->scopeDefault); goto nrjDE; nrjDE: if (empty($y28z9)) { return; } goto Tg30W; TN1Zw: } }