Laravel Eloquent - distinct() and count() not working properly together

前端 未结 12 1116
甜味超标
甜味超标 2020-12-04 15:54

So I\'m trying to get the number of distinct pids on a query, but the returned value is wrong.

This is what I try to do:

$ad->getcodes()->group         


        
12条回答
  •  一向
    一向 (楼主)
    2020-12-04 16:44

    This was working for me so Try This: $ad->getcodes()->distinct('pid')->count()

提交回复
热议问题