public function buyerAlreadybrand(){
$effect = Request::get(‘effect‘);
$data = $this->brand->where(function($query) use($effect){
if($effect == -1){
return $query->where(‘effectivetime‘,‘<‘,date(‘Y-m-d‘));
}else{
return $query->where(‘pur_date‘,‘<=‘,date(‘Y-m-d‘));
}
})->orderby(‘pur_date‘,‘desc‘)->get();
return View::make(‘member::publish.buyer_alreadybrand‘, compact(‘data‘))->withEffect($effect);
}
<li class="@if(!$effect) active @endif"><a href="?">已发布</a></li>
<li class="@if($effect == -1 ) active @endif"><a href="?effect=-1">已过期</a></li>