$totals = DB::table('subscribers')
->selectRaw('count(*) as total')
->selectRaw("count(case when status = 'confirmed' then 1 end) as confirmed")
->selectRaw("count(case when status = 'unconfirmed' then 1 end) as unconfirmed")
->selectRaw("count(case when status = 'cancelled' then 1 end) as cancelled")
->selectRaw("count(case when status = 'bounced' then 1 end) as bounced")
->first();
- это тоже для постгреса?
DB::table('property_values')
->select([ 'property_id', 'value', DB::raw('count(product_id) as attribute_count') ])
->whereIn('property_id', [1,4,5,6,7,8,9,16])
->groupBy(['property_id','value'])
->get();