更改
This commit is contained in:
parent
e2dd47c427
commit
cc545a5896
@ -41,8 +41,7 @@ namespace asg_form.Controllers
|
|||||||
if (user.officium == "Commentator")
|
if (user.officium == "Commentator")
|
||||||
{
|
{
|
||||||
TestDbContext testDb = new TestDbContext();
|
TestDbContext testDb = new TestDbContext();
|
||||||
string chinaname = user.chinaname;
|
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();
|
||||||
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();
|
|
||||||
|
|
||||||
return JsonConvert.SerializeObject(teamgame);
|
return JsonConvert.SerializeObject(teamgame);
|
||||||
}
|
}
|
||||||
|
@ -312,24 +312,28 @@ namespace asg_form.Controllers
|
|||||||
[Route("api/v2/admin/allperson")]
|
[Route("api/v2/admin/allperson")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<post_user_v2>> getalladmin_v2(string? keyword, short pageindex = 1, short pagesize = 10)
|
public async Task<ActionResult<post_user_v2>> 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");
|
bool isAdmin = this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin");
|
||||||
if (isAdmin)
|
if (isAdmin)
|
||||||
{
|
{
|
||||||
var a = new all_record();
|
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)
|
if (keyword == null)
|
||||||
{
|
{
|
||||||
a.cout = userManager.Users.Count();
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
a.cout = userManager.Users.Where(a => a.chinaname.Contains(keyword) || a.UserName == keyword || a.Email == keyword).Count();
|
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);
|
return Ok(a);
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ namespace asg_form.Controllers {
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var query2 = await sub.T_Comform.FirstOrDefaultAsync(n => n.id == query.relative_id);
|
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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
8
asg_form/Controllers/idvrole/RoleController.cs
Normal file
8
asg_form/Controllers/idvrole/RoleController.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace asg_form.Controllers.idvrole
|
||||||
|
{
|
||||||
|
//帮我写一个刚刚那个角色数据库的增删改查类
|
||||||
|
|
||||||
|
|
||||||
|
}
|
16
asg_form/Controllers/idvrole/Role_DB.cs
Normal file
16
asg_form/Controllers/idvrole/Role_DB.cs
Normal file
@ -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; }
|
||||||
|
}
|
||||||
|
//帮我写一个刚刚那个角色数据库的增删改查类
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user