<?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($L1g9F, $IJdfw, \Closure $R6Imz = null) { goto ahgDT; DQvvb: array_push($this->scopeFilters, array('name' => $L1g9F, 'title' => $IJdfw, 'filter' => $CJNWc)); goto uwOcj; jZ2Op: call_user_func($R6Imz, $CJNWc); goto DQvvb; ahgDT: $CJNWc = new ScopeFilter(); goto jZ2Op; uwOcj: return $this; goto IEIBS; IEIBS: } public function scopeDefault($L1g9F) { $this->scopeDefault = $L1g9F; return $this; } public function scopeParam() { goto SbycW; uLD_A: if (null === $Uwq_S) { return array(); } goto e6DfX; e6DfX: return array('_scope' => $Uwq_S); goto XSN3C; SbycW: $Uwq_S = $this->scopeValue(); goto uLD_A; XSN3C: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($zlK8N = null) { goto AF6zU; L9Ey9: $this->scopeAddedParam = $zlK8N; goto kCgG3; kCgG3: return $this; goto xZdfN; AF6zU: if (is_null($zlK8N)) { return $this->scopeAddedParam; } goto L9Ey9; xZdfN: } public function scopeExecuteQueries(&$lpymm) { goto zsPS5; Txibs: foreach ($this->scopeFilters as $W1xEA) { if ($W1xEA['name'] == $Um96w) { $CJNWc = $W1xEA['filter']; $CJNWc->executeQueries($lpymm); } } goto qxHn9; cyB5B: if (empty($Um96w)) { return; } goto Txibs; zsPS5: $Um96w = Input::get('_scope', $this->scopeDefault); goto cyB5B; qxHn9: } }