<?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($ZZMEd, $WtBPF, \Closure $b9NqF = null) { goto VKXDy; L4F2O: array_push($this->scopeFilters, array('name' => $ZZMEd, 'title' => $WtBPF, 'filter' => $Nxn6E)); goto A6vNy; A6vNy: return $this; goto VIxPT; X_TeL: call_user_func($b9NqF, $Nxn6E); goto L4F2O; VKXDy: $Nxn6E = new ScopeFilter(); goto X_TeL; VIxPT: } public function scopeDefault($ZZMEd) { $this->scopeDefault = $ZZMEd; return $this; } public function scopeParam() { goto VhP6z; HvMgt: return array('_scope' => $tFaSH); goto o9Vo7; VhP6z: $tFaSH = $this->scopeValue(); goto uTRuq; uTRuq: if (null === $tFaSH) { return array(); } goto HvMgt; o9Vo7: } public function scopeValue() { return Input::get('_scope', $this->scopeDefault); } public function scopeAddedParam($ACVUe = null) { goto RPzgy; RPzgy: if (is_null($ACVUe)) { return $this->scopeAddedParam; } goto e1DQc; e1DQc: $this->scopeAddedParam = $ACVUe; goto oh3Dw; oh3Dw: return $this; goto tbiwC; tbiwC: } public function scopeExecuteQueries(&$LBO09) { goto H6i3g; AyTRz: foreach ($this->scopeFilters as $BKlft) { if ($BKlft['name'] == $q_SZe) { $Nxn6E = $BKlft['filter']; $Nxn6E->executeQueries($LBO09); } } goto HrBs3; H6i3g: $q_SZe = Input::get('_scope', $this->scopeDefault); goto rqZI8; rqZI8: if (empty($q_SZe)) { return; } goto AyTRz; HrBs3: } }