Browse Source

Merge branch 'feature/snapshot' into test

qinchaoyue 3 months ago
parent
commit
d5b7e18112
1 changed files with 7 additions and 6 deletions
  1. 7 6
      src/Hotline.Application/Snapshot/RedPackApplication.cs

+ 7 - 6
src/Hotline.Application/Snapshot/RedPackApplication.cs

@@ -346,17 +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((sms, industry, snapshot) => new GetRedPackAuditSMSTemplateOutDto
-            { 
+            .Select(sms => new GetRedPackAuditSMSTemplateOutDto
+            {
                 Id = sms.Id,
                 Content = sms.Content
             })
-            .GroupBy(sms => new { sms.Id, sms.Content})
+            .GroupBy(sms => new { sms.Id, sms.Content })
             .ToListAsync();
         return items;
     }