select t.时间,sum(t.t) as 团购总计,sum(t.w) as 外卖总计 from (select 时间,支付金额 as t,0 as w from T_table union all select 时间,0,支付金额 from W_table) t group by t.时间;
select A.时间, A.团购总计, B.外卖总计 from (select 时间,sum(支付金额) as 团购总计 from T_table group by 时间) A join (select 时间,sum(支付金额) as 外卖总计 from w_table group by 时间) B on A.时间=B.时间