1
This commit is contained in:
		
							parent
							
								
									17b48ce7f4
								
							
						
					
					
						commit
						7756d881e6
					
				@ -167,7 +167,7 @@ namespace asg_form.Controllers
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        [Route("api/v1/admin/FindBlacks")]
 | 
					        [Route("api/v1/admin/FindBlacks")]
 | 
				
			||||||
        [HttpGet]
 | 
					        [HttpGet]
 | 
				
			||||||
        public async Task<ActionResult<object>> FindBlacks([FromQuery]string status = null, short page = 1, short limit = 10)
 | 
					        public async Task<ActionResult<object>> FindBlacks([FromQuery]string recordYear = null,string violator=null, short page = 1, short limit = 10)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            using (TestDbContext sub = new TestDbContext())
 | 
					            using (TestDbContext sub = new TestDbContext())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -176,6 +176,8 @@ namespace asg_form.Controllers
 | 
				
			|||||||
                var TotalRecords = await query.CountAsync();
 | 
					                var TotalRecords = await query.CountAsync();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var Tasks = await query
 | 
					                var Tasks = await query
 | 
				
			||||||
 | 
					                    .Where(g => g.record_time.Contains(recordYear) && g.violator==violator)
 | 
				
			||||||
 | 
					                    .OrderByDescending(n => n.record_time)
 | 
				
			||||||
                    .Skip((page - 1) * limit)
 | 
					                    .Skip((page - 1) * limit)
 | 
				
			||||||
                    .Take(limit)
 | 
					                    .Take(limit)
 | 
				
			||||||
                    .ToListAsync();
 | 
					                    .ToListAsync();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user