|
|
@ -66,7 +66,7 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
where create_time >= @0 and create_time < @1 |
|
|
|
group by user_id) temp |
|
|
|
left join users u on u.id = temp.user_id |
|
|
|
left join orgs o on o.id = u.id";
|
|
|
|
left join orgs o on o.id = u.org_id";
|
|
|
|
Page<Statistic> page = db.Page<Statistic>(pageIndex, pageSize, sql, fromTime, toTime, pageIndex, pageSize); |
|
|
|
return Pagination<Statistic>.FromPage(page); |
|
|
|
} |
|
|
@ -74,7 +74,7 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
public static Pagination<Statistic> OrgStatistics(DateTime fromTime, DateTime toTime, int pageIndex, int pageSize) |
|
|
|
{ |
|
|
|
string sql = $@"select temp.*, o.name org_name, o.name org_name2 from (
|
|
|
|
select org_id, count(*) compute_count, max(create_time) last_compute_time from computes |
|
|
|
select org_id, count(*) compute_count, max(create_time) last_compute_time from tasks |
|
|
|
where create_time >= @0 and create_time < @1 |
|
|
|
group by org_id) temp |
|
|
|
left join orgs o on o.id = temp.org_id";
|
|
|
|