This commit is contained in:
zpc 2025-09-27 17:25:04 +08:00
parent 2788fd0623
commit aabe3cf6f0
3 changed files with 66 additions and 0 deletions

View File

@ -199,4 +199,16 @@ namespace CoreCms.Net.Model.ViewModels.SQ
public int reservation_id { get; set; }
public List<SQReservationCheckInAttendeeDto> 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; }
}
}

View File

@ -157,6 +157,23 @@ public class SQController : ControllerBase
var where = PredicateBuilder.True<SQReservations>();
where = where.And(it => it.end_time > now);
where = where.And(it => it.status < 3);
//
List<int> userBlacklist = new List<int>();
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<int>($"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<SQReservationsApiDto>>(list);
if (pageList != null && pageList.Count > 0)
@ -1274,6 +1291,38 @@ public class SQController : ControllerBase
Msg = "签到失败"
};
}
}
/// <summary>
/// 订单支付记录(分页)
/// </summary>
[HttpGet]
[Authorize]
public async Task<WebApiDto> 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<SQPaymentRecordDto>(sql);
return new WebApiDto()
{
Code = 0,
Data = list,
Msg = "ok"
};
}
}

View File

@ -872,6 +872,11 @@
<param name="dto">签到参数:不包含发起者的参会名单</param>
<returns></returns>
</member>
<member name="M:CoreCms.Net.Web.WebApi.Controllers.SQController.GetPaymentRecords(System.Int32,System.Int32)">
<summary>
订单支付记录(分页)
</summary>
</member>
<member name="T:CoreCms.Net.Web.WebApi.Controllers.StoreController">
<summary>
门店调用接口数据