diff --git a/04.系统编码/DAL/TaskDAL.cs b/04.系统编码/DAL/TaskDAL.cs index 3673578..7886208 100644 --- a/04.系统编码/DAL/TaskDAL.cs +++ b/04.系统编码/DAL/TaskDAL.cs @@ -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 page = db.Page(pageIndex, pageSize, sql, fromTime, toTime, pageIndex, pageSize); return Pagination.FromPage(page); } @@ -74,7 +74,7 @@ namespace Pingchuan.BeijingSafeguard.DAL public static Pagination 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";