사용자별 최근 변경 사항 보는데 Trac report 만드는게 쉽지 않더군요. 더 쉬운 방법이 있는지 잘 모르겠지만… SQL 잘 하시는 분의 도움을 받아 만든 쿼리입니다. 저는 SQL을 잘게 짤라서 만드는 편인데, SQL 조금 복잡해지면 어렵고, 최적화도 어려워지죠.. 사용자 아이디와 출력되는 갯수가 하드코딩 되어야 해서 좀 그렇긴 하지만… 그래도 원하는대로 출력은 잘 해줍니다.
[code]
select
p.value AS __color__,
owner AS __group__,
id AS ticket,
(CASE status WHEN ‘assigned’ THEN owner||’ *’ ELSE owner END) AS owner,
summary,
component,
priority,
t.type AS type,
status,
time AS _created,
changetime AS modified,
description AS _description,
reporter AS _reporter
from (
select * from (SELECT * FROM ticket WHERE owner=’mix1009′ ORDER by changetime desc limit 0,5) u1
union
select * from (SELECT * FROM ticket WHERE owner=’user2′ ORDER by changetime desc limit 0,5) u2
union
select * from (SELECT * FROM ticket WHERE owner=’user3′ ORDER by changetime desc limit 0,5) u3
union
select * from (SELECT * FROM ticket WHERE owner=’user4′ ORDER by changetime desc limit 0,5) u4
union
select * from (SELECT * FROM ticket WHERE owner=’user5′ ORDER by changetime desc limit 0,5) u5
) t, enum p
where p.name = t.priority AND p.type = ‘priority’
order by owner, changetime desc
[/code]