diff --git a/Model/UserEntity.cs b/Model/UserEntity.cs index 91d0c75..d6a88e9 100644 --- a/Model/UserEntity.cs +++ b/Model/UserEntity.cs @@ -45,7 +45,7 @@ namespace LY.App.Model /// 用户关键防区数组 /// [SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地ids", IsJson = true)] - public List positionId { get; set; } + public List positionId { get; set; } [SugarColumn(IsIgnore = true)] /// /// 用户关键防区名称数组 @@ -68,7 +68,7 @@ namespace LY.App.Model public bool IsAdmin { get; set; } public List positionId { get; set; } } - public class UpdateUser:AddUser + public class UpdateUser : AddUser { public long Id { get; set; } } diff --git a/Service/UserService.cs b/Service/UserService.cs index 19c64fc..903137a 100644 --- a/Service/UserService.cs +++ b/Service/UserService.cs @@ -210,9 +210,9 @@ namespace LY.App.Service .ToPageListAsync(pageNum, pageSize, total); query.ForEach(s => { - if (s.positionId is not null && s.positionId.Any()) + if (s.positionId is not null && s.positionId.Any()) { - s.positionName= _db.Queryable().Where(p =>s.positionId.Contains(p.Id)).Select(p => p.Name).ToList(); + s.positionName = _db.Queryable().Where(p => s.positionId.Contains(p.Id.ToString())).Select(p => p.Name).ToList(); } }); return new