Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1213

Přidáno uživatelem Michal Kliment před asi 13 roky(ů)

Oprava chyb u clenu na bile listine.

Zobrazit rozdíly:

freenetis/branches/testing/application/models/member.php
a.id AS aid, a.comments_thread_id AS a_comments_thread_id,
ip.whitelisted, ip.ip_address, ip.id AS ip_address_id,
a_comment
FROM members m
LEFT JOIN users u ON u.member_id = m.id
LEFT JOIN devices d ON d.user_id = u.id
LEFT JOIN ifaces i ON i.device_id = d.id
LEFT JOIN vlan_ifaces vi ON vi.iface_id = i.id
LEFT JOIN ip_addresses ip ON (ip.iface_id = i.id OR ip.vlan_iface_id = vi.id OR ip.member_id = m.id)
FROM
(
SELECT ip.id, ip.whitelisted, ip.ip_address,
IFNULL(u.member_id, ip.member_id) AS member_id
FROM
(
SELECT ip.*, IFNULL(i1.device_id, i2.device_id) AS device_id
FROM ip_addresses ip
LEFT JOIN ifaces i1 ON ip.iface_id = i1.id
LEFT JOIN vlan_ifaces vi ON ip.vlan_iface_id = vi.id
LEFT JOIN ifaces i2 ON vi.iface_id = i2.id
WHERE ip.whitelisted > 0
) ip
LEFT JOIN devices d ON ip.device_id = d.id
LEFT JOIN users u ON d.user_id = u.id
) ip
JOIN members m ON ip.member_id = m.id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
LEFT JOIN
(
......
SELECT
m.id, IFNULL(f.translated_term, e.value) AS type,
m.name AS member_name, ip.whitelisted, a.balance
FROM members m
LEFT JOIN users u ON u.member_id = m.id
LEFT JOIN devices d ON d.user_id = u.id
LEFT JOIN ifaces i ON i.device_id = d.id
LEFT JOIN vlan_ifaces vi ON vi.iface_id = i.id
LEFT JOIN ip_addresses ip ON (ip.iface_id = i.id OR ip.vlan_iface_id = vi.id OR ip.member_id = m.id)
FROM
(
SELECT ip.id, ip.whitelisted, ip.ip_address,
IFNULL(u.member_id, ip.member_id) AS member_id
FROM
(
SELECT ip.*, IFNULL(i1.device_id, i2.device_id) AS device_id
FROM ip_addresses ip
LEFT JOIN ifaces i1 ON ip.iface_id = i1.id
LEFT JOIN vlan_ifaces vi ON ip.vlan_iface_id = vi.id
LEFT JOIN ifaces i2 ON vi.iface_id = i2.id
WHERE ip.whitelisted > 0
) ip
LEFT JOIN devices d ON ip.device_id = d.id
LEFT JOIN users u ON d.user_id = u.id
) ip
JOIN members m ON ip.member_id = m.id
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
LEFT JOIN comments_threads ct ON a.comments_thread_id = ct.id
LEFT JOIN enum_types e ON m.type = e.id

Také k dispozici: Unified diff