Awarding badges multiple times with custom SQL

I have a badge that’s awarded to people who attend one of our regular events. Because it’s not straightforward to grant badges en masse, I’m using custom SQL to grant the badge. What’s not working, though, is receiving the badge multiple times. I’ve tried to make this work by having one group per event, and including the group’s creation date as the granted_at field:

SELECT
	user_id,
	created_at granted_at,
	NULL post_id
FROM
	group_users
WHERE
	group_id IN (
		SELECT g.id FROM groups g WHERE g.name IN (
			'vit-2016-s2',
			'vit-2017-s1',
			'vit-2017-s2'
		)
	) AND (
		:backfill
		OR user_id IN (:user_ids)
	)

Even though I’m a member of all three of these groups, and in Data Explorer I see three results for my user, there’s still only one instance of the badge that’s granted.

How would I go about changing this so that the badge will automatically be awarded to each user for each group they’re a member of?

Sorry to bump this, but the next round of events is coming up soon and I’d love to have this fixed ahead of time. :wink: Any ideas on how I can grant a badge multiple times without it being linked to a post? (Or should I set the post_id to the announcement post using an ever-growing case statement?)

case 文を使用し、投稿をターゲットにすることで解決しました。つまり、手動で付与されないバッジは、投稿をターゲットにしている場合にのみ複数回付与できるようです。この点をページ上でより明確にできないでしょうか?これを提案するために Contribute > UXContribute > Feature に再投稿すべきでしょうか?