阅读背景:

如何选择计数并使用Laravel的fluent查询生成器?

来源:互联网 

in my case

在我的例子中

$products = $products->select(array('products.*', \DB::raw('COUNT(extra_fields.price) as price_count')))->leftJoin('extra_fields', 'products.id', '=', 'extra_fields.item_id')
                    ->where('item_type', 'App\Models\Product')
                    ->whereRaw("price = '0'")
                    ->whereRaw("price_count = 1")
                    ->groupBy('item_id')
                    ->groupBy('price')

                ;
$products = $products->s



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: