website icon indicating copy to clipboard operation
website copied to clipboard

Number of classes is wrong

Open karbassi opened this issue 5 years ago • 0 comments

The volunteer count of number of classes attended should be of classes they have a check_in value.

A quick example of my information. Currently the website says I've taught 101 classes. But I've only checked in 89.

-- 89
SELECT count(*)
FROM
	coderdojochi_mentororder "order"
	INNER JOIN coderdojochi_mentor "mentor" ON "mentor"."id" = "order"."mentor_id"
	INNER JOIN coderdojochi_cdcuser "user" ON "user"."id" = "mentor"."user_id"
WHERE
	"user"."id" = 2 
	AND "order"."check_in" IS NOT NULL
;
-- 101
SELECT count(*)
FROM
	coderdojochi_mentororder "order"
	INNER JOIN coderdojochi_mentor "mentor" ON "mentor"."id" = "order"."mentor_id"
	INNER JOIN coderdojochi_cdcuser "user" ON "user"."id" = "mentor"."user_id"
WHERE
	"user"."id" = 2 
;

karbassi avatar Apr 10 '19 13:04 karbassi