Browse Source

Add org parameter

master
fanwensheng 3 years ago
parent
commit
9bacb7166f
  1. 4
      04.系统编码/App/Controllers/UserManagementController.cs
  2. 4
      04.系统编码/BLL/UserBLL.cs
  3. 5
      04.系统编码/DAL/UserDAL.cs

4
04.系统编码/App/Controllers/UserManagementController.cs

@ -36,9 +36,9 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers
}
[HttpPost]
public JsonResult Query(int pageIndex, int pageSize)
public JsonResult Query(int orgId, int pageIndex, int pageSize)
{
Pagination<User> users = UserBLL.Query(pageIndex, pageSize);
Pagination<User> users = UserBLL.Query(orgId, pageIndex, pageSize);
return Json(users);
}
}

4
04.系统编码/BLL/UserBLL.cs

@ -38,9 +38,9 @@ namespace Pingchuan.BeijingSafeguard.BLL
return UserDAL.Delete(id);
}
public static Pagination<User> Query(int pageIndex, int pageSize)
public static Pagination<User> Query(int orgId, int pageIndex, int pageSize)
{
return UserDAL.Query(pageIndex, pageSize);
return UserDAL.Query(orgId, pageIndex, pageSize);
}
}

5
04.系统编码/DAL/UserDAL.cs

@ -44,9 +44,10 @@ namespace Pingchuan.BeijingSafeguard.DAL
return db.Execute(sql);
}
public static Pagination<User> Query(int pageIndex, int pageSize)
public static Pagination<User> Query(int orgId, int pageIndex, int pageSize)
{
string sql = $@"select * from users order by create_time desc";
string condition = orgId == 0 ? string.Empty : $"where org_id = {orgId}";
string sql = $@"select * from users {condition} order by create_time desc";
Page<User> users = db.Page<User>(pageIndex, pageSize, sql);
return Pagination<User>.FromPage(users);
}

Loading…
Cancel
Save