Browse Source

我的项目接口 新增 是否参与过夸克类型项目 判断 并返回相关项目详情

lifa 1 year ago
parent
commit
6fe0872fca
1 changed files with 14 additions and 3 deletions
  1. 14 3
      src/platform/ZhonTai.Admin/Services/DiTuiAPI/ProjectsService.cs

+ 14 - 3
src/platform/ZhonTai.Admin/Services/DiTuiAPI/ProjectsService.cs

@@ -78,6 +78,17 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
                     ProjectName = ""
                 });
 
+            // 查询是否取过夸克类型项目
+            var kuaKeList = _kuaKeRepository.Select
+                .Where(m => m.CreatedUserId == User.Id)
+                .GroupBy(m => new { m.ProjectId })
+                .ToList(m => new ProjectLinkManagePageOutput()
+                {
+                    ProjectId = m.Key.ProjectId,
+                    Count = m.Count(),
+                    UseCount = m.Count(),
+                });
+
             var priceList = await _projectConfigRepository.Select
                 .Where(m=> m.EffectDate < DateTime.Now)
                 .OrderByDescending(m => m.DrawAmount)
@@ -89,10 +100,10 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
                         ProjectPriceId = m.ProjectPriceId,
                         DrawAmount = m.DrawAmount,
                         EffectDate = m.EffectDate,
-                    }); 
-
+                    });
 
-            var listProjectId = linkList.Select(m => m.ProjectId).Distinct().ToList();
+            var linkResult = linkList.Union(kuaKeList);
+            var listProjectId = linkResult.Select(m => m.ProjectId).Distinct().ToList();
             var listProject = new List<MyProject>();
             if (listProjectId.Count() > 0)
             {