直接查数据库吧
SELECT x.realname as 姓名, x.product_name as 所属产品,
x.id as 编号, x.task_name as 任务名称, x.pri as 优先级,
x.estStarted as 预计开始, x.realStarted as 实际开始, x.deadline as 截止日期, x.finishedDate as 实际完成, DATEDIFF(x.finishedDate, x.deadline) as 延期(天),
format(x.estimate,1) as 最初预计, format(x.consumed,1) as 任务总消耗 FROM
(SELECT
a.id,a.project, b.realname,
a.name as task_name, a.pri,
d.name as product_name, a.consumed, a.estimate, a.estStarted, a.deadline, a.realStarted, a.finishedDate FROM `zt_task` a
join zt_user b on a.finishedBy = b.account
join (select project, min(product) as product from zt_projectproduct group by project) c on a.project = c.project
join zt_product d on c.product =
d.id where a.status in ("done", "closed")
and a.deleted = 1
and a.finishedDate >={start} and a.finishedDate < {end}
) x
ORDER BY x.realname, x.product_name, x.finishedDate