diff --git a/asg_form/Controllers/Com.cs b/asg_form/Controllers/Com.cs index 1f0d5eb..4740700 100644 --- a/asg_form/Controllers/Com.cs +++ b/asg_form/Controllers/Com.cs @@ -37,7 +37,7 @@ namespace asg_form.Controllers { 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.bilibiliuri, a.commentary, a.referee ,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.bilibiliuri, a.commentary, a.referee ,a.opentime,a.team1_piaoshu,a.team2_piaoshu}).OrderByDescending(a => a.opentime).ToList(); return JsonConvert.SerializeObject(teamgame); } diff --git a/asg_form/Controllers/news.cs b/asg_form/Controllers/news.cs index a421958..cf74a1a 100644 --- a/asg_form/Controllers/news.cs +++ b/asg_form/Controllers/news.cs @@ -109,7 +109,7 @@ namespace asg_form.Controllers if (a) { TestDbContext ctx = new TestDbContext(); - await ctx.news.AddAsync(new T_news { Title = req_News.Title, msg = req_News.msg, FormName = user.UserName ,time=DateTime.Now}); + await ctx.news.AddAsync(new T_news { Title = req_News.Title, msg = req_News.msg, FormName = user.UserName ,time=DateTime.Now,Type=req_News.Type}); await ctx.SaveChangesAsync(); return "ok!"; } @@ -144,6 +144,7 @@ namespace asg_form.Controllers qwq.msg=req_News.msg; qwq.Title=req_News.Title; qwq.FormName = user.UserName; + qwq.Type = req_News.Type; await ctx.SaveChangesAsync(); } @@ -172,7 +173,8 @@ public class T_news public DateTime? time { get; set; } public string msg { get; set; } - } + public string Type { get; set; } +} public class req_news { /// @@ -183,6 +185,7 @@ public class T_news /// 内容,推荐使用markdown格式 /// public string msg { get; set; } - - } + public string Type { get; set; } + +}