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
Wouldn't this work?
$ad->getcodes()->distinct()->get(['pid'])->count();
See here for discussion..