|
@@ -37,6 +37,7 @@ using Hotline.ThirdAccountDomainServices.Interfaces;
|
|
|
using Hotline.Snapshot.IRepository;
|
|
|
using Hotline.Share.Enums.CallCenter;
|
|
|
using Hotline.Repository.SqlSugar.Snapshot;
|
|
|
+using Hotline.Settings.Hotspots;
|
|
|
|
|
|
namespace Hotline.Application.Snapshot;
|
|
|
|
|
@@ -479,9 +480,11 @@ public abstract class SnapshotApplicationBase
|
|
|
public async Task<IList<RedPackOutDto>> GetRedPacksAsync(RedPacksInDto dto, CancellationToken cancellationToken)
|
|
|
{
|
|
|
var items = await _redPackRecordRepository.Queryable(includeDeleted: true)
|
|
|
+ .LeftJoin<Order>((m , order) => m.OrderId == order.Id)
|
|
|
.Where(m => m.IsDeleted == false)
|
|
|
.Where(m => m.WXOpenId == _sessionContext.OpenId)
|
|
|
- .Where(m => m.PickupStatus == dto.Status)
|
|
|
+ .WhereIF(dto.Status == ERedPackPickupStatus.Unreceived, (m, order) => m.PickupStatus == dto.Status && (order.HotspotId == null || order.HotspotId.StartsWith("18") == false))
|
|
|
+ .WhereIF(dto.Status != ERedPackPickupStatus.Unreceived, (m, order) => m.PickupStatus == dto.Status)
|
|
|
.Where(m => m.CreationTime.ToString("yyyy-MM") == dto.Time)
|
|
|
.LeftJoin<Order>((red, order) => red.OrderId == order.Id)
|
|
|
.Select((red, order) => new RedPackOutDto
|