Commit 4bb317ba authored by 黄奎's avatar 黄奎

新增字段

parent d64363f0
......@@ -24,5 +24,13 @@ namespace EduSpider.IRepository
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentListRepository(CourseQuery query);
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowTypeRepository(int ShowType, string Ids);
}
}
......@@ -93,5 +93,13 @@ namespace EduSpider.IServices
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Stu_Comment> GetStuCommentList(CourseQuery query);
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowType(int ShowType, string Ids);
}
}
......@@ -60,5 +60,9 @@ namespace EduSpider.Model.Entity
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 显示类型(1-全部可见,2-部分可见,3-不可见)
/// </summary>
public int ShowType { get; set; }
}
}
......@@ -71,5 +71,17 @@ WHERE 1=1
}
return flag;
}
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowTypeRepository(int ShowType, string Ids)
{
string sql = string.Format("UPDATE RB_Stu_Comment SET ShowType={0} WHERE Id IN({1}) ", ShowType, Ids);
return base.Execute(sql) > 0;
}
}
}
......@@ -277,7 +277,7 @@ namespace EduSpider.Services
item.student_name,
item.student_uid,
item.score,
item.score_p,
score_p=item.score_p*100,
add_time = VTX.FW.Helper.ConvertHelper.FormatDate(item.add_time)
});
}
......@@ -356,5 +356,16 @@ namespace EduSpider.Services
var list = StuCommentRepository.GetStuCommentListRepository(query);
return list;
}
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <param name="ShowType"></param>
/// <param name="Ids"></param>
/// <returns></returns>
public bool SetStuCommentShowType(int ShowType, string Ids)
{
return StuCommentRepository.SetStuCommentShowTypeRepository(ShowType, Ids);
}
}
}
......@@ -9,6 +9,7 @@ using VTX.FW.Api;
using VTX.FW.Attr;
using VTX.FW.Helper;
using System.Linq;
using EduSpider.Model.Query;
namespace EduSpider.WebApi.Controllers
{
......@@ -38,14 +39,14 @@ namespace EduSpider.WebApi.Controllers
TeacherIds = userInfo.AccountId.ToString(),
KeyWords = base.ReqParameters.GetString("KeyWords"),
};
//全部课程
List<object> AllCourseList = new();
//已结课
List<object> FinishList = new();
//进行中
List<object> NotFinishList = new();
var list = CourseService.GetTeacherCourseList(query).Where(qitem=>qitem.CourseStatus==1 || qitem.CompleteNum==qitem.TotalClassNum).ToList();
var list = CourseService.GetTeacherCourseList(query).Where(qitem => qitem.CourseStatus == 1 || qitem.CompleteNum == qitem.TotalClassNum).ToList();
if (list != null && list.Count > 0)
{
......@@ -61,7 +62,7 @@ namespace EduSpider.WebApi.Controllers
item.TeacherName,
};
AllCourseList.Add(obj);
if (item.CompleteNum==item.TotalClassNum)
if (item.CompleteNum == item.TotalClassNum)
{
FinishList.Add(obj);
}
......@@ -238,13 +239,13 @@ namespace EduSpider.WebApi.Controllers
{
var model = new RB_Stu_Comment()
{
Id=base.ReqParameters.GetInt("Id"),
HomeWorkId=base.ReqParameters.GetInt("HomeWorkId"),
StuUid=base.ReqParameters.GetInt("StuUid"),
CourseId=base.ReqParameters.GetInt("CourseId"),
Times=base.ReqParameters.GetInt("Times"),
Info=base.ReqParameters.GetString("Info"),
CreateType=base.ReqParameters.GetInt("CreateType"),
Id = base.ReqParameters.GetInt("Id"),
HomeWorkId = base.ReqParameters.GetInt("HomeWorkId"),
StuUid = base.ReqParameters.GetInt("StuUid"),
CourseId = base.ReqParameters.GetInt("CourseId"),
Times = base.ReqParameters.GetInt("Times"),
Info = base.ReqParameters.GetString("Info"),
CreateType = base.ReqParameters.GetInt("CreateType"),
};
model.CreateTime = System.DateTime.Now;
model.CreateBy = base.BaseUserId;
......@@ -252,5 +253,37 @@ namespace EduSpider.WebApi.Controllers
var flag = CourseService.SetStuComment(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
[HttpPost]
[HttpGet]
/// <summary>
/// 修改学员评论状态
/// </summary>
/// <returns></returns>
public ApiResult SetStuCommentShowType()
{
string Ids = base.ReqParameters.GetString("Ids");
int ShowType = base.ReqParameters.GetInt("ShowType");
var flag = CourseService.SetStuCommentShowType(ShowType, Ids);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
[HttpPost]
[HttpGet]
/// <summary>
/// 获取学员评论列表
/// </summary>
/// <returns></returns>
public ApiResult GetStuCommentList()
{
var query = new CourseQuery()
{
};
var list = CourseService.GetStuCommentList(query);
return ApiResult.Success(data: list);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment