用户列表防区管理
This commit is contained in:
		
							parent
							
								
									b21479beed
								
							
						
					
					
						commit
						bca6baef65
					
				| 
						 | 
				
			
			@ -46,6 +46,11 @@ namespace LY.App.Model
 | 
			
		|||
        /// </summary>
 | 
			
		||||
        [SugarColumn(ColumnName = "position_id", ColumnDescription = "阵地ids", IsJson = true)]
 | 
			
		||||
        public List<long> positionId { get; set; }
 | 
			
		||||
        [SugarColumn(IsIgnore = true)]
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// 用户关键防区名称数组
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public List<string> positionName { get; set; }
 | 
			
		||||
    }
 | 
			
		||||
    public class AddUser
 | 
			
		||||
    {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -208,6 +208,13 @@ namespace LY.App.Service
 | 
			
		|||
                .WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key))
 | 
			
		||||
                .OrderBy(s => s.Id)
 | 
			
		||||
                .ToPageListAsync(pageNum, pageSize, total);
 | 
			
		||||
            query.ForEach(s =>
 | 
			
		||||
            {
 | 
			
		||||
                if (s.positionId is not null &&  s.positionId.Any())
 | 
			
		||||
                {
 | 
			
		||||
                    s.positionName= _db.Queryable<PositionInfo>().Where(p =>s.positionId.Contains(p.Id)).Select(p => p.Name).ToList();
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            return new
 | 
			
		||||
            {
 | 
			
		||||
                total = total.Value,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue