<?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($glP3G, $sEiap, \Closure $liNDm = null) { goto mf4PS; O_UEx: call_user_func($liNDm, $DMbpM); goto QNlcv; QNlcv: array_push($this->scopeFilters, array('name' => $glP3G, 'title' => $sEiap, 'filter' => $DMbpM)); goto fcV1q; mf4PS: $DMbpM = new ScopeFilter(); goto O_UEx; fcV1q: return $this; goto RUujU; RUujU: } public function scopeDefault($glP3G) { $this->scopeDefault = $glP3G; return $this; } public function scopeParam() { goto VlpHD; w6mIc: return array('_scope' => $xeyDx); goto tmLgA; km0xS: if (null === $xeyDx) { return array(); } goto w6mIc; VlpHD: $xeyDx = $this->scopeValue(); goto km0xS; tmLgA: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($mattM = null) { goto fMv8f; cSWaG: return $this; goto JTe_N; fMv8f: if (is_null($mattM)) { return $this->scopeAddedParam; } goto R4KBL; R4KBL: $this->scopeAddedParam = $mattM; goto cSWaG; JTe_N: } public function scopeExecuteQueries(&$nYIOS) { goto hjR35; v9_4d: foreach ($this->scopeFilters as $jLQt1) { if ($jLQt1['name'] == $EF8S3) { $DMbpM = $jLQt1['filter']; $DMbpM->executeQueries($nYIOS); } } goto q6C9I; hjR35: $EF8S3 = Input::get('_scope', $this->scopeDefault); goto Rj96N; Rj96N: if (empty($EF8S3)) { return; } goto v9_4d; q6C9I: } }