laravel where orwhere 写法

$goodsShow = Goods::where('cate_id','=',$cate_id)   
 ->where(function($query){       

 $query->where('status','<','61')    
        ->orWhere(function($query){    
            $query->where('status', '91');    
       });  
  })
->first();

这一段其实执行的就是where cate_id = $cate_id AND (status < 61 OR status = 91)

你可能感兴趣的:(laravel where orwhere 写法)