Overview
Comment:Fix service order in subscription
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 981308eb4bc2b5584f9963d224fd03e1b633d7d8
User & Date: bohwaz on 2020-12-08 19:04:24
Other Links: manifest | tags
Context
2020-12-08
20:36
Fix checkbox in query builder check-in: 58d52846fc user: bohwaz tags: trunk, stable
19:04
Fix service order in subscription check-in: 981308eb4b user: bohwaz tags: trunk, stable
18:59
Fix redirect after having found a single user in quicksearch check-in: 41b2924cc0 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Services/Services.php from [5ec46b1538] to [c0c763cc9c].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	}

	static public function listGroupedWithFees(?int $user_id = null)
	{
		$services = DB::getInstance()->getGrouped('SELECT
			id, label, duration, start_date, end_date, description,
			CASE WHEN end_date IS NOT NULL THEN end_date WHEN duration IS NOT NULL THEN date(\'now\', \'+\'||duration||\' days\') ELSE NULL END AS expiry_date
			FROM services;');
		$fees = Fees::listAllByService($user_id);
		$out = [];

		foreach ($services as $service) {
			$out[$service->id] = $service;
			$out[$service->id]->fees = [];
		}







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	}

	static public function listGroupedWithFees(?int $user_id = null)
	{
		$services = DB::getInstance()->getGrouped('SELECT
			id, label, duration, start_date, end_date, description,
			CASE WHEN end_date IS NOT NULL THEN end_date WHEN duration IS NOT NULL THEN date(\'now\', \'+\'||duration||\' days\') ELSE NULL END AS expiry_date
			FROM services ORDER BY label COLLATE NOCASE;');
		$fees = Fees::listAllByService($user_id);
		$out = [];

		foreach ($services as $service) {
			$out[$service->id] = $service;
			$out[$service->id]->fees = [];
		}