Browse Source

团组模块 - 出入境费用-移动端 - 团组基础数据Data --> 增加团组Id验证

LEIYI 3 months ago
parent
commit
e524c6a6e8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      OASystem/OASystem.Api/Controllers/GroupsController.cs

+ 5 - 1
OASystem/OASystem.Api/Controllers/GroupsController.cs

@@ -7239,9 +7239,13 @@ FROM
 
             RefAsync<int> total = 0;
 
+            int diId = 0;
+            var status = int.TryParse(dto.GroupName, out diId);
+
             var data = await _sqlSugar.Queryable<Grp_DelegationInfo>()
                 .Where(x => x.IsDel == 0 && !string.IsNullOrEmpty(x.TeamName))
-                .WhereIF(!string.IsNullOrEmpty(dto.GroupName), x => x.TeamName.Contains(dto.GroupName))
+                .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && diId > 0, x => x.Id == diId)
+                .WhereIF(!string.IsNullOrEmpty(dto.GroupName) && !status, x => x.TeamName.Contains(dto.GroupName))
                 .Select(x => new
                 {
                     Id = x.Id,