hhx 3 years ago
parent
commit
095fd6455c
  1. 1
      04.系统编码/BLL/UserBLL.cs
  2. 4
      04.系统编码/DAL/UserDAL.cs
  3. 3
      04.系统编码/Model/User.cs

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

@ -23,6 +23,7 @@ namespace Pingchuan.BeijingSafeguard.BLL
user.Enabled = 1;
user.ComputeCount = 0;
user.LastComputeTime = null;
user.LoginCount = 0;
user.LastLoginTime = null;
user.CreateTime = DateTime.Now;
return UserDAL.Add(user);

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

@ -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);

3
04.系统编码/Model/User.cs

@ -22,6 +22,9 @@ namespace Pingchuan.BeijingSafeguard.Model
[Column("real_name")]
public string RealName { set; get; }
[Column("is_sa")]
public int IsSa { set; get; }
[Column("login_name")]
public string LoginName { set; get; }

Loading…
Cancel
Save