fix 轨迹查询时区不传默认为+8

This commit is contained in:
李鹏军 2024-03-06 11:03:25 +08:00
parent 447ea8ae8f
commit 7365a23f63
2 changed files with 9 additions and 3 deletions

View File

@ -20,7 +20,13 @@ public class GetTrackInput
/// 时区 +8 +8.25 -8.5 -9
/// 不传默认+8
/// </summary>
public float? TimeZone { get; set; } = 8;
private float? _timeZone;
public float? TimeZone
{
get => _timeZone ?? 8;
set => _timeZone = value;
}
/// <summary>
/// 排序方式

View File

@ -55,8 +55,8 @@ public class TrackQueryService : ApplicationService
Status = x.TrackStatus,
Content = x.TrackContent,
Location = x.TrackPlace,
Time = x.TrackTime.AddHours(input.TimeZone!.Value - x.TrackTimeZone),
TimeZone = input.TimeZone!.Value
Time = x.TrackTime.AddHours(input.TimeZone ?? 8 - x.TrackTimeZone),
TimeZone = input.TimeZone ?? 8
}).ToList();
res.Add(item);