diff --git a/asg_form/Controllers/Com.cs b/asg_form/Controllers/Com.cs index b15d63c..31ae07c 100644 --- a/asg_form/Controllers/Com.cs +++ b/asg_form/Controllers/Com.cs @@ -41,8 +41,7 @@ namespace asg_form.Controllers if (user.officium == "Commentator") { TestDbContext testDb = new TestDbContext(); - string chinaname = user.chinaname; - var teamgame = testDb.team_Games.Where(a => a.commentary.IndexOf(chinaname) >= 0).Select(a => new { a.id, a.team1_name, a.team2_name,a.belong,a.tag, a.bilibiliuri, a.commentary, a.referee,a.judge,a.person_type ,a.opentime,a.team1_piaoshu,a.team2_piaoshu}).OrderByDescending(a => a.opentime).ToList(); + var teamgame = testDb.team_Games.Where(a => a.commentary.IndexOf(id) >= 0).Select(a => new { a.id, a.team1_name, a.team2_name,a.belong,a.tag, a.bilibiliuri, a.commentary, a.referee,a.judge,a.person_type ,a.opentime,a.team1_piaoshu,a.team2_piaoshu}).OrderByDescending(a => a.opentime).ToList(); return JsonConvert.SerializeObject(teamgame); } diff --git a/asg_form/Controllers/admin.cs b/asg_form/Controllers/admin.cs index 2c0a502..30cdd59 100644 --- a/asg_form/Controllers/admin.cs +++ b/asg_form/Controllers/admin.cs @@ -312,24 +312,28 @@ namespace asg_form.Controllers [Route("api/v2/admin/allperson")] [HttpGet] [Authorize] - public async Task> getalladmin_v2(string? keyword, short pageindex = 1, short pagesize = 10) + public async Task> getalladmin_v2(string? keyword, short pageindex = 1, short pagesize = 10,string? offficum = null) { bool isAdmin = this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin"); if (isAdmin) { var a = new all_record(); - + if(keyword== null && offficum == null) + { + a.cout = userManager.Users.Count(); + a.msg = await userManager.Users.Paginate(pageindex, pagesize).Select(a => new { a.Id, a.Email, a.chinaname, a.UserName, a.Integral, a.officium,a.qqnumber,a.roleListName,a.roleListCode }).ToListAsync(); + } if (keyword == null) { a.cout = userManager.Users.Count(); - a.msg = await userManager.Users.Paginate(pageindex, pagesize).Select(a => new { a.Id, a.Email, a.chinaname, a.UserName, a.Integral, a.officium,a.qqnumber,a.roleListName,a.roleListCode}).ToListAsync(); + a.msg = await userManager.Users.Paginate(pageindex, pagesize).Where(a=>a.officium==offficum).Select(a => new { a.Id, a.Email, a.chinaname, a.UserName, a.Integral, a.officium,a.qqnumber,a.roleListName,a.roleListCode}).ToListAsync(); } else { a.cout = userManager.Users.Where(a => a.chinaname.Contains(keyword) || a.UserName == keyword || a.Email == keyword).Count(); - a.msg = await userManager.Users.Where(a => a.chinaname.Contains(keyword) || a.UserName == keyword || a.Email == keyword).Paginate(pageindex, pagesize).Select(a => new { a.Id, a.Email, a.chinaname, a.UserName, a.Integral, a.officium,a.qqnumber, a.roleListName, a.roleListCode }).ToListAsync(); + a.msg = await userManager.Users.Where(a => a.chinaname.Contains(keyword) || a.UserName == keyword || a.Email == keyword&&a.officium==offficum).Paginate(pageindex, pagesize).Select(a => new { a.Id, a.Email, a.chinaname, a.UserName, a.Integral, a.officium,a.qqnumber, a.roleListName, a.roleListCode }).ToListAsync(); } return Ok(a); } diff --git a/asg_form/Controllers/auditAndFilingController.cs b/asg_form/Controllers/auditAndFilingController.cs index 7a4db02..19c5ec9 100644 --- a/asg_form/Controllers/auditAndFilingController.cs +++ b/asg_form/Controllers/auditAndFilingController.cs @@ -257,7 +257,7 @@ namespace asg_form.Controllers { try { var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == query.relative_id); - if (query2 != null) query2.status = "1"; + if (query2 != null) query2.status = "3"; } catch (Exception ex) { diff --git a/asg_form/Controllers/idvrole/RoleController.cs b/asg_form/Controllers/idvrole/RoleController.cs new file mode 100644 index 0000000..963ef4b --- /dev/null +++ b/asg_form/Controllers/idvrole/RoleController.cs @@ -0,0 +1,8 @@ +using Microsoft.AspNetCore.Mvc; + +namespace asg_form.Controllers.idvrole +{ + //帮我写一个刚刚那个角色数据库的增删改查类 + + +} diff --git a/asg_form/Controllers/idvrole/Role_DB.cs b/asg_form/Controllers/idvrole/Role_DB.cs new file mode 100644 index 0000000..09aa3ba --- /dev/null +++ b/asg_form/Controllers/idvrole/Role_DB.cs @@ -0,0 +1,16 @@ +namespace asg_form.Controllers.idvrole +{ + //帮我写一个存储角色的数据库表,要有角色名称,角色头像url,角色全身图片,角色的选择率,选择的禁用率,获胜次数 + public class RoleDB + { + public int id { get; set; } + public string role_name { get; set; } + public string role_head { get; set; } + public string role_body { get; set; } + public int role_probability { get; set; } + public int role_disable { get; set; } + public int role_win { get; set; } + } + //帮我写一个刚刚那个角色数据库的增删改查类 + +}