优化 写入选科时候无数据导致的异常 #56

Merged
hy merged 1 commits from dev into staging 2025-12-09 14:14:45 +08:00
1 changed files with 8 additions and 0 deletions

View File

@ -498,7 +498,14 @@ namespace Learn.Archives.API.Controllers
}, ex => { throw ex; });
}
//写入选科方向
userCenterUpdate = userCenterUpdate.Where(s =>
new object[] { s.Phone,
s.GLSubject,
s.GSubject1,
s.GSubject2,}
.Any(x => !(x == default || x == null))).ToList();
if (userCenterUpdate.Count > 0)
{
await userService.AsUpdateable(userCenterUpdate)
.UpdateColumns(s => new
{
@ -511,6 +518,7 @@ namespace Learn.Archives.API.Controllers
.IgnoreColumns(ignoreAllNullColumns: true, ignoreAllDefaultValue: true)
.WhereColumns(it => new { it.Id })
.ExecuteCommandAsync();
}
return Ok();
}