Overview
Comment:Fix list of users with no fee
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 9a19bff0846c06678edf9847bc52644420948a6b57699660391d7cce06c580d8
User & Date: bohwaz on 2022-01-01 17:59:18
Other Links: manifest | tags
Context
2022-01-01
18:02
Fix edit of service subscription was wrongly found as duplicate when it exists check-in: 00ae9fa2ba user: bohwaz tags: trunk, stable
17:59
Fix list of users with no fee check-in: 9a19bff084 user: bohwaz tags: trunk, stable
17:56
Display past services if there are no current services check-in: 74c8f4744b user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Entities/Services/Service.php from [bac627a89f] to [82c82246f7].

102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
				'select' => 'su.date',
			],
		];

		$tables = 'services_users su
			INNER JOIN membres m ON m.id = su.id_user
			INNER JOIN services s ON s.id = su.id_service
			INNER JOIN services_fees sf ON sf.id = su.id_fee
			INNER JOIN (SELECT id, MAX(date) FROM services_users GROUP BY id_user, id_service) AS su2 ON su2.id = su.id';
		$conditions = sprintf('su.id_service = %d AND su.paid = 1 AND (su.expiry_date >= date() OR su.expiry_date IS NULL)
			AND m.id_category NOT IN (SELECT id FROM users_categories WHERE hidden = 1)', $this->id());

		$list = new DynamicList($columns, $tables, $conditions);
		$list->groupBy('su.id_user');
		$list->orderBy('date', true);







|







102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
				'select' => 'su.date',
			],
		];

		$tables = 'services_users su
			INNER JOIN membres m ON m.id = su.id_user
			INNER JOIN services s ON s.id = su.id_service
			LEFT JOIN services_fees sf ON sf.id = su.id_fee
			INNER JOIN (SELECT id, MAX(date) FROM services_users GROUP BY id_user, id_service) AS su2 ON su2.id = su.id';
		$conditions = sprintf('su.id_service = %d AND su.paid = 1 AND (su.expiry_date >= date() OR su.expiry_date IS NULL)
			AND m.id_category NOT IN (SELECT id FROM users_categories WHERE hidden = 1)', $this->id());

		$list = new DynamicList($columns, $tables, $conditions);
		$list->groupBy('su.id_user');
		$list->orderBy('date', true);