laravel where orwhere的写法

小天天天天    PHP    999+ 次    2019-05-26 02:54:10


$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)

1202438-20171207110858509-1290365763.png


如果你觉得本篇文章对您有帮助,请打赏作者

上一篇: 错误Trait method restore has not been applied, because there are collisions with解决方法

下一篇: CentOS7挂载新的数据盘

最新评论

暂无评论

热门文章

最新评论

网站数据

网站文章数:481

今日UV/PV/IP:13/15/13

昨日UV/PV/IP:33/37 /33

TOP