Commit 826d0084 authored by OnceUponAFoodsharingTime's avatar OnceUponAFoodsharingTime Committed by Matthias Larisch

Resolve "Sort list by Alpabet, not by opening date."

parent 74f1a496
Pipeline #20752708 passed with stages
in 10 minutes and 14 seconds
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
## Features ## Features
- decreased distance to "close baskets" from 50 to 30 km. !332 #338 by @peter.toennies - decreased distance to "close baskets" from 50 to 30 km. !332 #338 by @peter.toennies
- sort fairtiler list by name. !357 #171 by @k.miklobusec
## Bugfixes ## Bugfixes
- Remove info section from foodsaver page, if it is empty !320 - Remove info section from foodsaver page, if it is empty !320
......
...@@ -24,10 +24,10 @@ class FairTeilerGateway extends BaseGateway ...@@ -24,10 +24,10 @@ class FairTeilerGateway extends BaseGateway
fs.`nachname`, fs.`nachname`,
fs.`email`, fs.`email`,
fs.`geschlecht` fs.`geschlecht`
FROM `fs_fairteiler_follower` ff, FROM `fs_fairteiler_follower` ff,
`fs_foodsaver` fs `fs_foodsaver` fs
WHERE ff.foodsaver_id = fs.id WHERE ff.foodsaver_id = fs.id
AND ff.fairteiler_id = :id AND ff.fairteiler_id = :id
AND ff.infotype = 1 AND ff.infotype = 1
...@@ -42,16 +42,16 @@ class FairTeilerGateway extends BaseGateway ...@@ -42,16 +42,16 @@ class FairTeilerGateway extends BaseGateway
UNIX_TIMESTAMP(wp.time) AS time_ts, UNIX_TIMESTAMP(wp.time) AS time_ts,
wp.body, wp.body,
wp.attach, wp.attach,
fs.name AS fs_name fs.name AS fs_name
FROM fs_fairteiler_has_wallpost hw FROM fs_fairteiler_has_wallpost hw
LEFT JOIN fs_wallpost wp LEFT JOIN fs_wallpost wp
ON hw.wallpost_id = wp.id ON hw.wallpost_id = wp.id
LEFT JOIN fs_foodsaver fs ON wp.foodsaver_id = fs.id LEFT JOIN fs_foodsaver fs ON wp.foodsaver_id = fs.id
WHERE hw.fairteiler_id = :id WHERE hw.fairteiler_id = :id
ORDER BY wp.id DESC ORDER BY wp.id DESC
LIMIT 1 LIMIT 1
', [':id' => $id]); ', [':id' => $id]);
...@@ -88,10 +88,10 @@ class FairTeilerGateway extends BaseGateway ...@@ -88,10 +88,10 @@ class FairTeilerGateway extends BaseGateway
fs.`nachname`, fs.`nachname`,
fs.`email`, fs.`email`,
fs.sleep_status fs.sleep_status
FROM `fs_fairteiler_follower` ff, FROM `fs_fairteiler_follower` ff,
`fs_foodsaver` fs `fs_foodsaver` fs
WHERE ff.foodsaver_id = fs.id WHERE ff.foodsaver_id = fs.id
AND ff.fairteiler_id = ' . (int)$id . ' AND ff.fairteiler_id = ' . (int)$id . '
'); ');
...@@ -106,6 +106,7 @@ class FairTeilerGateway extends BaseGateway ...@@ -106,6 +106,7 @@ class FairTeilerGateway extends BaseGateway
FROM `fs_fairteiler` FROM `fs_fairteiler`
WHERE `bezirk_id` IN( ' . implode(',', $bezirk_ids) . ' ) WHERE `bezirk_id` IN( ' . implode(',', $bezirk_ids) . ' )
AND `status` = 1 AND `status` = 1
ORDER BY `name`
', []) ', [])
) { ) {
foreach ($fairteiler as $key => $ft) { foreach ($fairteiler as $key => $ft) {
...@@ -133,13 +134,14 @@ class FairTeilerGateway extends BaseGateway ...@@ -133,13 +134,14 @@ class FairTeilerGateway extends BaseGateway
ft.`picture`, ft.`picture`,
bz.id AS bezirk_id, bz.id AS bezirk_id,
bz.name AS bezirk_name bz.name AS bezirk_name
FROM `fs_fairteiler` ft, FROM `fs_fairteiler` ft,
`fs_bezirk` bz `fs_bezirk` bz
WHERE ft.bezirk_id = bz.id WHERE ft.bezirk_id = bz.id
AND ft.`bezirk_id` IN(' . implode(',', $bezirk_ids) . ') AND ft.`bezirk_id` IN(' . implode(',', $bezirk_ids) . ')
AND ft.`status` = 1 AND ft.`status` = 1
ORDER BY ft.`name`
')) '))
) { ) {
$out = array(); $out = array();
...@@ -203,12 +205,12 @@ class FairTeilerGateway extends BaseGateway ...@@ -203,12 +205,12 @@ class FairTeilerGateway extends BaseGateway
fs.`photo`, fs.`photo`,
ff.type, ff.type,
fs.sleep_status fs.sleep_status
FROM fs_foodsaver fs, FROM fs_foodsaver fs,
fs_fairteiler_follower ff fs_fairteiler_follower ff
WHERE ff.foodsaver_id = fs.id WHERE ff.foodsaver_id = fs.id
AND ff.fairteiler_id = :id AND ff.fairteiler_id = :id
', [':id' => $id]) ', [':id' => $id])
) { ) {
$normal = array(); $normal = array();
...@@ -273,13 +275,13 @@ class FairTeilerGateway extends BaseGateway ...@@ -273,13 +275,13 @@ class FairTeilerGateway extends BaseGateway
ft.`add_foodsaver`, ft.`add_foodsaver`,
fs.name AS fs_name, fs.name AS fs_name,
fs.nachname AS fs_nachname, fs.nachname AS fs_nachname,
fs.id AS fs_id fs.id AS fs_id
FROM fs_fairteiler ft FROM fs_fairteiler ft
LEFT JOIN LEFT JOIN
fs_foodsaver fs fs_foodsaver fs
ON ft.add_foodsaver = fs.id ON ft.add_foodsaver = fs.id
WHERE ft.id = :id WHERE ft.id = :id
', [':id' => $id]) ', [':id' => $id])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment