1
This commit is contained in:
parent
cc545a5896
commit
fd2be60ff2
@ -246,7 +246,7 @@ namespace asg_form.Controllers
|
|||||||
[Route("api/v1/admin/FindTasks")]
|
[Route("api/v1/admin/FindTasks")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Authorize]
|
[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);
|
//string encodedChinaname = HttpUtility.UrlEncode(chinaname);
|
||||||
|
|
||||||
@ -260,9 +260,9 @@ namespace asg_form.Controllers
|
|||||||
|
|
||||||
var query = sub.T_Task.AsQueryable();
|
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))
|
if (!string.IsNullOrEmpty(status))
|
||||||
@ -270,7 +270,11 @@ namespace asg_form.Controllers
|
|||||||
query = query.Where(n => n.status == status);
|
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();
|
var TotalRecords = await query.CountAsync();
|
||||||
|
|
||||||
@ -336,6 +340,8 @@ namespace asg_form.Controllers
|
|||||||
public string taskDescription { get; set; }
|
public string taskDescription { get; set; }
|
||||||
public long money { get; set; }
|
public long money { get; set; }
|
||||||
public string priority { get; set; }
|
public string priority { get; set; }
|
||||||
|
public long userId { get; set; }
|
||||||
|
public string chinaname { get; set; }
|
||||||
}
|
}
|
||||||
[Route("api/v1/admin/UpdateTasks")]
|
[Route("api/v1/admin/UpdateTasks")]
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
@ -357,6 +363,8 @@ namespace asg_form.Controllers
|
|||||||
task.money = msg.money;
|
task.money = msg.money;
|
||||||
task.taskName = msg.taskName;
|
task.taskName = msg.taskName;
|
||||||
task.priority = msg.priority;
|
task.priority = msg.priority;
|
||||||
|
task.userId = msg.userId;
|
||||||
|
task.chinaname = msg.chinaname;
|
||||||
await db.SaveChangesAsync();
|
await db.SaveChangesAsync();
|
||||||
return Ok(new { code = 200, message = "已修改" });
|
return Ok(new { code = 200, message = "已修改" });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user