From 4762ea002b63ccdee87d96f59f9d06e81b16a702 Mon Sep 17 00:00:00 2001 From: yanghongwei Date: Sun, 22 Jun 2025 18:11:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4=EF=BC=8Clo?= =?UTF-8?q?ng=20=E8=BD=ACstring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/UserEntity.cs | 4 ++-- Service/UserService.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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