Browse Source

Merge branch 'test' of http://110.188.24.182:10023/Fengwo/hotline into test

田爽 3 months ago
parent
commit
550b4e01fc
1 changed files with 10 additions and 5 deletions
  1. 10 5
      src/Hotline.Application/Snapshot/RedPackApplication.cs

+ 10 - 5
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -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;
     }