Update activity_model.php for postgres

This fixes the postgres GROUPBY error:  

"must appear in the GROUP BY clause or be used in an aggregate function"

which appears when you don't add all the select fields to the groupby clause.