Als 'SELLER' keine Bestellungen an mich sichtbar
Person 119 sieht keine Bestellungen auf Verteilpunkt 36, darf diese aber als "SELLER" sehen und bearbeiten.
https://test.mygood.at/de/shop/myshop/myorders
mysql> select seq_id from person where username='ohonigfe';
+--------+
| seq_id |
+--------+
| 119 |
+--------+
1 row in set (0,01 sec)
mysql> select * from persongroup_members where fperson_member_seq_id=119;
+--------+------+-----------------------+---------------------+------------------------+----------------+---------------------+
| seq_id | name | fperson_member_seq_id | fpersongroup_seq_id | fperson_contact_seq_id | member_type_kz | fquest_level_seq_id |
+--------+------+-----------------------+---------------------+------------------------+----------------+---------------------+
| 72 | NULL | 119 | 16 | 85 | NULL | 775 |
| 96 | NULL | 119 | 27 | 9 | SELLER | 775 |
+--------+------+-----------------------+---------------------+------------------------+----------------+---------------------+
2 rows in set (0,00 sec)
mysql> select * from persongroup where seq_id=27;
+--------+---------------------------+------------------------+----------+--------+------------------------+-------------------+---------+
| seq_id | name | fperson_contact_seq_id | security | public | fgroup_category_seq_id | is_function_group | content |
+--------+---------------------------+------------------------+----------+--------+------------------------+-------------------+---------+
| 27 | Verteilpunkt St. Ruprecht | 9 | C | C | NULL | 0 | O |
+--------+---------------------------+------------------------+----------+--------+------------------------+-------------------+---------+
1 row in set (0,00 sec)
mysql> select seq_id,name from collective_distribution where fpersongroup_seq_id=27;
+--------+-----------------------+
| seq_id | name |
+--------+-----------------------+
| 36 | FoodCoop St. Ruprecht |
+--------+-----------------------+
1 row in set (0,00 sec)
mysql>
query += " AND (cd.fperson_contact_seq_id = "+req.query.DistUserId+" OR EXISTS (SELECT 1 FROM persongroup_members pgm WHERE pgm.member_type_kz IN ('ADMIN','SELLER') AND pgm.fpersongroup_seq_id = cd.fpersongroup_seq_id AND pgm.fperson_member_seq_id = "+req.query.DistUserId+"))";