From aabe3cf6f01de87631555b68041b14673e377870 Mon Sep 17 00:00:00 2001 From: zpc Date: Sat, 27 Sep 2025 17:25:04 +0800 Subject: [PATCH] 321 --- .../ViewModels/SQ/SQReservationsDto.cs | 12 +++++ .../Controllers/SQController.cs | 49 +++++++++++++++++++ CoreCms.Net.Web.WebApi/Doc.xml | 5 ++ 3 files changed, 66 insertions(+) diff --git a/CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs b/CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs index 664f54d..b3089b8 100644 --- a/CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs +++ b/CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs @@ -199,4 +199,16 @@ namespace CoreCms.Net.Model.ViewModels.SQ public int reservation_id { get; set; } public List attendeds { get; set; } } + + + public class SQPaymentRecordDto + { + public string title { get; set; } + public string paymentId { get; set; } + public int is_refund { get; set; } + public DateTime? join_time { get; set; } + public int status { get; set; } + public string is_refund_text { get; set; } + } + } diff --git a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs index 7239358..b0b4f6a 100644 --- a/CoreCms.Net.Web.WebApi/Controllers/SQController.cs +++ b/CoreCms.Net.Web.WebApi/Controllers/SQController.cs @@ -157,6 +157,23 @@ public class SQController : ControllerBase var where = PredicateBuilder.True(); where = where.And(it => it.end_time > now); where = where.And(it => it.status < 3); + // + List userBlacklist = new List(); + if (userId > 0) + { + //_sQRoomUnavailableTimesServices.get + userBlacklist = await _coreCmsUserBlacklistServices.GetUserBlacklists(userId); + if (userBlacklist.Count > 0) + { + string sqlWhere = string.Join(",", userBlacklist); + var participants = await _dbBase.Ado.SqlQueryAsync($"select sq.id from SQReservations sq left join SQReservationParticipants p on sq.id=p.reservation_id and p.role=1 where sq.status<3 and p.user_id in ({sqlWhere})"); + if (participants.Count > 0) + { + where = where.And(it => !participants.Contains(it.id)); + } + + } + } var list = await _SQReservationsServices.QueryPageAsync(where, it => it.start_time, OrderByType.Asc, pageIndex, pageSize, true); var pageList = _mapper.Map>(list); if (pageList != null && pageList.Count > 0) @@ -1274,6 +1291,38 @@ public class SQController : ControllerBase Msg = "签到失败" }; } + + + } + + /// + /// 订单支付记录(分页) + /// + [HttpGet] + [Authorize] + public async Task GetPaymentRecords([FromQuery] int pageIndex = 1, [FromQuery] int pageSize = 20) + { + var userId = _user.ID; + if (pageIndex < 1) pageIndex = 1; + if (pageSize <= 0) pageSize = 20; + + var sql = $@"SELECT sq.title, p.paymentId, p.is_refund, p.join_time, p.status, +CASE p.is_refund WHEN 1 THEN N'待支付' WHEN 2 THEN N'已支付' WHEN 3 THEN N'待退款' WHEN 4 THEN N'已退款' ELSE N'' END AS is_refund_text +FROM SQReservationParticipants p +LEFT JOIN SQReservations sq ON p.reservation_id = sq.id +WHERE p.user_id = {userId} AND p.is_refund > 0 AND p.paymentId IS NOT NULL AND p.paymentId <> '' +ORDER BY p.id DESC +OFFSET {(pageIndex - 1) * pageSize} ROWS FETCH NEXT {pageSize} ROWS ONLY"; + + var list = await _dbBase.Ado.SqlQueryAsync(sql); + + return new WebApiDto() + { + Code = 0, + Data = list, + Msg = "ok" + }; } } + diff --git a/CoreCms.Net.Web.WebApi/Doc.xml b/CoreCms.Net.Web.WebApi/Doc.xml index 8ddab8f..4efe59c 100644 --- a/CoreCms.Net.Web.WebApi/Doc.xml +++ b/CoreCms.Net.Web.WebApi/Doc.xml @@ -872,6 +872,11 @@ 签到参数:不包含发起者的参会名单 + + + 订单支付记录(分页) + + 门店调用接口数据