Overview
Comment:Fix count users in list of services
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 93119deb9c061dfa75812605075e2c25c7081bdc5eb9fc7bb26ca9cc42500726
User & Date: bohwaz on 2022-11-10 14:47:31
Other Links: manifest | tags
Context
2022-11-10
14:48
Add psalm config, even though it's useless check-in: e0e643a082 user: bohwaz tags: trunk
14:47
Fix count users in list of services check-in: 93119deb9c user: bohwaz tags: trunk, stable
2022-11-09
18:20
Fix numbers in list of services check-in: fe5ca275f0 user: bohwaz tags: trunk, stable, 1.2.2
Changes

Modified src/include/lib/Garradin/Services/Services.php from [25df3ae571] to [e0ebf1e9e3].

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
			INSERT INTO services_list_stats SELECT
				id_service, id_user,
				CASE WHEN (expiry_date IS NULL OR expiry_date >= date()) AND paid = 1 THEN 1 ELSE 0 END,
				CASE WHEN expiry_date < date() THEN 1 ELSE 0 END,
				paid
			FROM services_users su
			INNER JOIN (SELECT id, MAX(date) FROM services_users GROUP BY id_user, id_service) su2 ON su2.id = su.id
			INNER JOIN membres m ON m.id = su.id_user WHERE %s',
			$db->where('m.id_category', 'NOT IN', $hidden_cats));

		$db->exec($sql);


		$columns = [
			'id' => [],
			'duration' => [],







|
|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
			INSERT INTO services_list_stats SELECT
				id_service, id_user,
				CASE WHEN (expiry_date IS NULL OR expiry_date >= date()) AND paid = 1 THEN 1 ELSE 0 END,
				CASE WHEN expiry_date < date() THEN 1 ELSE 0 END,
				paid
			FROM services_users su
			INNER JOIN (SELECT id, MAX(date) FROM services_users GROUP BY id_user, id_service) su2 ON su2.id = su.id
			INNER JOIN membres m ON m.id = su.id_user WHERE m.%s;',
			$db->where('id_category', 'NOT IN', $hidden_cats));

		$db->exec($sql);


		$columns = [
			'id' => [],
			'duration' => [],