Merge branch 'master' of https://dev.azure.com/luolan/ASG/_git/asg_backend
This commit is contained in:
commit
72b7ef4d7b
@ -246,7 +246,7 @@ namespace asg_form.Controllers
|
||||
[Route("api/v1/admin/FindTasks")]
|
||||
[HttpGet]
|
||||
[Authorize]
|
||||
public async Task<ActionResult<object>> FindTasks([FromQuery] string chinaname = null,string status = null,short page = 1,short limit = 10)
|
||||
public async Task<ActionResult<object>> FindTasks([FromQuery] long userId = -1,string priority = null,string status = null,short page = 1,short limit = 10)
|
||||
{
|
||||
//string encodedChinaname = HttpUtility.UrlEncode(chinaname);
|
||||
|
||||
@ -260,9 +260,9 @@ namespace asg_form.Controllers
|
||||
|
||||
var query = sub.T_Task.AsQueryable();
|
||||
|
||||
if (!string.IsNullOrEmpty(chinaname))
|
||||
if (!string.IsNullOrEmpty(priority))
|
||||
{
|
||||
query = query.Where(n => n.chinaname.Contains(chinaname));
|
||||
query = query.Where(n => n.priority == priority);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(status))
|
||||
@ -270,7 +270,11 @@ namespace asg_form.Controllers
|
||||
query = query.Where(n => n.status == status);
|
||||
}
|
||||
|
||||
// var customOrder = new[] { "1","0","3","2" };
|
||||
if (userId != -1)
|
||||
{
|
||||
query = query.Where(n => n.userId == userId);
|
||||
}
|
||||
// var customOrder = new[] { "1","0","3","2" };
|
||||
|
||||
var TotalRecords = await query.CountAsync();
|
||||
|
||||
@ -336,6 +340,8 @@ namespace asg_form.Controllers
|
||||
public string taskDescription { get; set; }
|
||||
public long money { get; set; }
|
||||
public string priority { get; set; }
|
||||
public long userId { get; set; }
|
||||
public string chinaname { get; set; }
|
||||
}
|
||||
[Route("api/v1/admin/UpdateTasks")]
|
||||
[HttpPut]
|
||||
@ -357,6 +363,8 @@ namespace asg_form.Controllers
|
||||
task.money = msg.money;
|
||||
task.taskName = msg.taskName;
|
||||
task.priority = msg.priority;
|
||||
task.userId = msg.userId;
|
||||
task.chinaname = msg.chinaname;
|
||||
await db.SaveChangesAsync();
|
||||
return Ok(new { code = 200, message = "已修改" });
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user