<?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($rPkIY, $yP7h6, \Closure $r1VBm = null) { goto S_G4r; H6x5M: call_user_func($r1VBm, $JCV6U); goto dZwnR; S_G4r: $JCV6U = new ScopeFilter(); goto H6x5M; dZwnR: array_push($this->scopeFilters, array('name' => $rPkIY, 'title' => $yP7h6, 'filter' => $JCV6U)); goto Rglld; Rglld: return $this; goto Lfzdy; Lfzdy: } public function scopeDefault($rPkIY) { $this->scopeDefault = $rPkIY; return $this; } public function scopeParam() { goto N0o0l; u2k78: if (null === $RPWsF) { return array(); } goto Y6zHT; N0o0l: $RPWsF = $this->scopeValue(); goto u2k78; Y6zHT: return array('_scope' => $RPWsF); goto S4V_E; S4V_E: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($Kp99R = null) { goto q2NRu; zTvE3: return $this; goto JTou0; q2NRu: if (is_null($Kp99R)) { return $this->scopeAddedParam; } goto WFgSg; WFgSg: $this->scopeAddedParam = $Kp99R; goto zTvE3; JTou0: } public function scopeExecuteQueries(&$AOBVZ) { goto NSULK; diWle: if (empty($k709l)) { return; } goto VnzZ8; NSULK: $k709l = Input::get('_scope', $this->scopeDefault); goto diWle; VnzZ8: foreach ($this->scopeFilters as $BhZ7n) { if ($BhZ7n['name'] == $k709l) { $JCV6U = $BhZ7n['filter']; $JCV6U->executeQueries($AOBVZ); } } goto V8xfl; V8xfl: } }