Revize 1888
Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)
freenetis/branches/1.1/application/models/member.php | ||
---|---|---|
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) mi ON mi.member_id = m.id
|
||
) AS m
|
||
LEFT JOIN users u ON u.member_id = m.id
|
||
LEFT JOIN address_points ap ON m.address_point_id = ap.id
|
||
LEFT JOIN streets s ON ap.street_id = s.id
|
||
LEFT JOIN towns t ON ap.town_id = t.id
|
||
... | ... | |
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) mi ON mi.member_id = m.id
|
||
) AS m
|
||
LEFT JOIN users u ON u.member_id = m.id
|
||
LEFT JOIN address_points ap ON m.address_point_id = ap.id
|
||
LEFT JOIN streets s ON ap.street_id = s.id
|
||
LEFT JOIN towns t ON ap.town_id = t.id
|
||
... | ... | |
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
|
||
LEFT JOIN comments_threads ct ON a.comments_thread_id = ct.id
|
||
LEFT JOIN comments c ON ct.id = c.comments_thread_id
|
||
LEFT JOIN users u ON c.user_id = u.id
|
||
LEFT JOIN users cu ON c.user_id = cu.id
|
||
LEFT JOIN enum_types e ON m.type = e.id
|
||
LEFT JOIN translations f ON e.value = f.original_term AND lang = ?
|
||
LEFT JOIN
|
||
... | ... | |
redirect_type_id
|
||
FROM
|
||
(
|
||
SELECT
|
||
m.id, m.registration, m.name,
|
||
s.street, ap.street_number, t.town, t.quarter,
|
||
vs.variable_symbol, m.type, m.entrance_date,
|
||
m.leaving_date,
|
||
u.birthday, u.login, m.comment, m.membership_interrupt,
|
||
ms.redirect_type_id
|
||
FROM
|
||
(
|
||
SELECT m.id,
|
||
m.name,
|
||
m.address_point_id,
|
||
registration,
|
||
SELECT
|
||
m.id, m.registration, m.name,
|
||
s.street, ap.street_number, t.town, t.quarter,
|
||
vs.variable_symbol, m.type, m.entrance_date,
|
||
m.leaving_date,
|
||
u.birthday, u.login, m.comment, m.membership_interrupt,
|
||
ms.redirect_type_id
|
||
FROM
|
||
(
|
||
SELECT m.id,
|
||
m.name,
|
||
m.address_point_id,
|
||
registration,
|
||
type, entrance_fee,
|
||
IF(mi.id IS NOT NULL, 1, 0) AS membership_interrupt,
|
||
m.comment, m.entrance_date, m.leaving_date,
|
||
organization_identifier
|
||
FROM members m
|
||
IF(mi.id IS NOT NULL, 1, 0) AS membership_interrupt,
|
||
m.comment, m.entrance_date, m.leaving_date,
|
||
organization_identifier
|
||
FROM members m
|
||
LEFT JOIN
|
||
(
|
||
SELECT mi.id, mi.member_id
|
||
FROM membership_interrupts mi
|
||
LEFT JOIN members_fees mf ON mi.members_fee_id = mf.id
|
||
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) mi ON mi.member_id = m.id
|
||
) AS m
|
||
LEFT JOIN address_points ap ON m.address_point_id = ap.id
|
||
LEFT JOIN streets s ON ap.street_id = s.id
|
||
LEFT JOIN towns t ON ap.town_id = t.id
|
||
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
|
||
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
|
||
LEFT JOIN users u ON u.member_id = m.id AND u.type = ?
|
||
LEFT JOIN enum_types e ON m.type = e.id
|
||
LEFT JOIN devices d ON d.user_id = u.id
|
||
LEFT JOIN ifaces i ON i.device_id = d.id
|
||
LEFT JOIN ip_addresses ip ON ip.iface_id = i.id
|
||
LEFT JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
LEFT JOIN
|
||
(
|
||
SELECT mi.id, mi.member_id
|
||
FROM membership_interrupts mi
|
||
LEFT JOIN members_fees mf ON mi.members_fee_id = mf.id
|
||
WHERE mf.activation_date <= CURDATE() AND mf.deactivation_date >= CURDATE()
|
||
) mi ON mi.member_id = m.id
|
||
) AS m
|
||
LEFT JOIN address_points ap ON m.address_point_id = ap.id
|
||
LEFT JOIN streets s ON ap.street_id = s.id
|
||
LEFT JOIN towns t ON ap.town_id = t.id
|
||
LEFT JOIN accounts a ON a.member_id = m.id AND m.id <> 1
|
||
LEFT JOIN variable_symbols vs ON vs.account_id = a.id
|
||
LEFT JOIN users u ON u.member_id = m.id AND u.type = ?
|
||
LEFT JOIN enum_types e ON m.type = e.id
|
||
LEFT JOIN devices d ON d.user_id = u.id
|
||
LEFT JOIN ifaces i ON i.device_id = d.id
|
||
LEFT JOIN ip_addresses ip ON ip.iface_id = i.id
|
||
LEFT JOIN messages_ip_addresses mip ON mip.ip_address_id = ip.id
|
||
LEFT JOIN
|
||
(
|
||
SELECT m.*, type AS redirect_type_id
|
||
FROM messages m
|
||
) ms ON mip.message_id = ms.id
|
||
LEFT JOIN
|
||
(
|
||
SELECT c.id AS cloud,
|
||
IFNULL(u.member_id, c.member_id) AS member_id
|
||
FROM
|
||
SELECT m.*, type AS redirect_type_id
|
||
FROM messages m
|
||
) ms ON mip.message_id = ms.id
|
||
LEFT JOIN
|
||
(
|
||
SELECT c.*, i.device_id, ip.member_id
|
||
FROM clouds c
|
||
JOIN clouds_subnets cs ON cs.cloud_id = c.id
|
||
JOIN subnets s ON cs.subnet_id = s.id
|
||
JOIN ip_addresses ip ON ip.subnet_id = s.id
|
||
JOIN ifaces i ON ip.iface_id = i.id
|
||
) c
|
||
LEFT JOIN devices d ON c.device_id = d.id
|
||
LEFT JOIN users u ON d.user_id = u.id
|
||
) cl ON cl.member_id = m.id
|
||
$filter_sql
|
||
SELECT c.id AS cloud,
|
||
IFNULL(u.member_id, c.member_id) AS member_id
|
||
FROM
|
||
(
|
||
SELECT c.*, i.device_id, ip.member_id
|
||
FROM clouds c
|
||
JOIN clouds_subnets cs ON cs.cloud_id = c.id
|
||
JOIN subnets s ON cs.subnet_id = s.id
|
||
JOIN ip_addresses ip ON ip.subnet_id = s.id
|
||
JOIN ifaces i ON ip.iface_id = i.id
|
||
) c
|
||
LEFT JOIN devices d ON c.device_id = d.id
|
||
LEFT JOIN users u ON d.user_id = u.id
|
||
) cl ON cl.member_id = m.id
|
||
$filter_sql
|
||
) AS q
|
||
GROUP BY q.id
|
||
ORDER BY q.id
|
||
) AS q
|
||
GROUP BY q.id
|
||
ORDER BY q.id
|
||
) AS q
|
||
", array
|
||
(
|
||
Config::get('lang'),
|
||
User_Model::MAIN_USER
|
||
));
|
||
}
|
freenetis/branches/1.1/application/controllers/members.php | ||
---|---|---|
->type('select')
|
||
->values(ORM::factory('cloud')->select_list());
|
||
|
||
$filter_form->add('login')
|
||
->label('Login name')
|
||
->table('u')
|
||
->callback('json/user_login');
|
||
|
||
return $filter_form;
|
||
}
|
||
|
Také k dispozici: Unified diff
Upravy:
- filtr login uzivatele ve clenech