When you are using aggregation function you have to in GROUP BY clause list every column which you have in your SELECT, so you have to list A.restaurant_id in GROUP BY becouse you use this column in SELECT.
In my opinion you haven't to using B.restaurant_name, A.restaurant_id is enough.