|
@@ -346,13 +346,18 @@ public class RedPackApplication : IRedPackApplication, IScopeDependency
|
|
|
/// <returns></returns>
|
|
|
public async Task<IList<GetRedPackAuditSMSTemplateOutDto>> GetRedPackAuditSMSTemplateAsync(GetRedPackAuditSMSTemplateInDto dto)
|
|
|
{
|
|
|
+ var industryId = await _orderSnapshotRepository.Queryable()
|
|
|
+ .Where(m => m.Id == dto.OrderId)
|
|
|
+ .Select(m => m.IndustryId).FirstAsync();
|
|
|
var items = await _snapshotSMSTemplateRepository.Queryable(includeDeleted: true)
|
|
|
- .LeftJoin<Industry>((sms, industry) => sms.IndustryId == industry.Id)
|
|
|
- .LeftJoin<OrderSnapshot>((sms, industry, snapshot) => snapshot.IndustryId == industry.Id)
|
|
|
- .Where((sms, industry, snapshot) => (sms.IsPublic == true || sms.IndustryId == snapshot.IndustryId)
|
|
|
+ .Where(sms => (sms.IsPublic == true || sms.IndustryId == industryId)
|
|
|
&& sms.Status == dto.Status && sms.IsEnable == true && sms.IsDeleted == false)
|
|
|
- .Select<GetRedPackAuditSMSTemplateOutDto>()
|
|
|
- .Distinct()
|
|
|
+ .Select(sms => new GetRedPackAuditSMSTemplateOutDto
|
|
|
+ {
|
|
|
+ Id = sms.Id,
|
|
|
+ Content = sms.Content
|
|
|
+ })
|
|
|
+ .GroupBy(sms => new { sms.Id, sms.Content })
|
|
|
.ToListAsync();
|
|
|
return items;
|
|
|
}
|