|
|
@ -46,10 +46,10 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
|
|
|
|
public static Pagination<UserDTO> Query(int orgId, int pageIndex, int pageSize) |
|
|
|
{ |
|
|
|
string condition = orgId == 0 ? string.Empty : $"where u.org_id = {orgId}"; |
|
|
|
string condition = orgId == 0 ? string.Empty : $"and u.org_id = {orgId}"; |
|
|
|
string sql = $@"select u.*, o.name org_name from users u
|
|
|
|
left join orgs o on o.id = u.org_id |
|
|
|
{condition} |
|
|
|
where is_sa <> 1 {condition} |
|
|
|
order by u.create_time desc";
|
|
|
|
Page<UserDTO> users = db.Page<UserDTO>(pageIndex, pageSize, sql); |
|
|
|
return Pagination<UserDTO>.FromPage(users); |
|
|
|