Commit ff8a44f4 authored by 黄奎's avatar 黄奎

页面修改

parent 2916f392
...@@ -47,10 +47,10 @@ namespace EduSpider.IRepository ...@@ -47,10 +47,10 @@ namespace EduSpider.IRepository
/// 根据课程评论次数修改可见等级 /// 根据课程评论次数修改可见等级
/// </summary> /// </summary>
/// <param name="CourseId">课程编号</param> /// <param name="CourseId">课程编号</param>
/// <param name="Times">次数</param> /// <param name="CommentMainId">评价主表编号</param>
/// <param name="ShowType">可见性</param> /// <param name="ShowType">可见性</param>
/// <returns></returns> /// <returns></returns>
public bool SetStuCommentShowTypeByTimesRepository(int CourseId, int Times, int ShowType); public bool SetStuCommentShowTypeByTimesRepository(int CourseId, int CommentMainId, int ShowType);
/// <summary> /// <summary>
/// 根据编号删除学员评论 /// 根据编号删除学员评论
......
...@@ -114,10 +114,10 @@ namespace EduSpider.IServices ...@@ -114,10 +114,10 @@ namespace EduSpider.IServices
/// 根据课程评论次数修改可见等级 /// 根据课程评论次数修改可见等级
/// </summary> /// </summary>
/// <param name="CourseId">课程编号</param> /// <param name="CourseId">课程编号</param>
/// <param name="Times">次数</param> /// <param name="CommentMainId">评价主表编号</param>
/// <param name="ShowType">可见性</param> /// <param name="ShowType">可见性</param>
/// <returns></returns> /// <returns></returns>
public bool SetStuCommentShowTypeByTimes(int CourseId, int Times, int ShouType); public bool SetStuCommentShowTypeByTimes(int CourseId, int CommentMainId, int ShouType);
/// <summary> /// <summary>
/// 根据编号删除学员评论 /// 根据编号删除学员评论
......
...@@ -125,12 +125,12 @@ WHERE 1=1 ...@@ -125,12 +125,12 @@ WHERE 1=1
/// 根据课程编号和次数修改评价可见状态 /// 根据课程编号和次数修改评价可见状态
/// </summary> /// </summary>
/// <param name="CourseId"></param> /// <param name="CourseId"></param>
/// <param name="Times"></param> /// <param name="CommentMainId">评价主表编号</param>
/// <param name="ShowType"></param> /// <param name="ShowType"></param>
/// <returns></returns> /// <returns></returns>
public bool SetStuCommentShowTypeByTimesRepository(int CourseId, int Times, int ShowType) public bool SetStuCommentShowTypeByTimesRepository(int CourseId, int CommentMainId, int ShowType)
{ {
string sql = string.Format("UPDATE RB_Stu_CommentDetails SET ShowType={0} WHERE CourseId={1} AND Times={2}", ShowType, CourseId, Times); string sql = string.Format("UPDATE RB_Stu_CommentDetails SET ShowType={0} WHERE CourseId={1} AND CommentMainId={2}", ShowType, CourseId, CommentMainId);
return base.Execute(sql) > 0; return base.Execute(sql) > 0;
} }
......
...@@ -403,12 +403,12 @@ namespace EduSpider.Services ...@@ -403,12 +403,12 @@ namespace EduSpider.Services
/// 根据课程评论次数修改可见等级 /// 根据课程评论次数修改可见等级
/// </summary> /// </summary>
/// <param name="CourseId">课程编号</param> /// <param name="CourseId">课程编号</param>
/// <param name="Times">次数</param> /// <param name="CommentMainId">评价主表编号</param>
/// <param name="ShowType">可见性</param> /// <param name="ShowType">可见性</param>
/// <returns></returns> /// <returns></returns>
public bool SetStuCommentShowTypeByTimes(int CourseId, int Times, int ShowType) public bool SetStuCommentShowTypeByTimes(int CourseId, int CommentMainId, int ShowType)
{ {
return StuCommentDetailsRepository.SetStuCommentShowTypeByTimesRepository(CourseId, Times, ShowType); return StuCommentDetailsRepository.SetStuCommentShowTypeByTimesRepository(CourseId, CommentMainId, ShowType);
} }
...@@ -432,10 +432,16 @@ namespace EduSpider.Services ...@@ -432,10 +432,16 @@ namespace EduSpider.Services
var list = StuCommentRepository.GetCourseCommentTimesListRepository(query); var list = StuCommentRepository.GetCourseCommentTimesListRepository(query);
if (list != null && list.Count > 0) if (list != null && list.Count > 0)
{ {
string qIds = string.Join(",", list.Select(qitem => qitem.Id));
List<RB_Stu_CommentDetails_Extend> detailsList = new List<RB_Stu_CommentDetails_Extend>();
if (!string.IsNullOrEmpty(qIds))
{
detailsList= StuCommentDetailsRepository.GetStuCommentDetailsListRepository(new RB_Stu_CommentDetails_Extend() { QCommentMainIds = qIds });
}
foreach (var item in list) foreach (var item in list)
{ {
int ShowType = 3; int ShowType = 3;
var subList = StuCommentDetailsRepository.GetStuCommentDetailsListRepository(new RB_Stu_CommentDetails_Extend() { CourseId = item.CourseId, Times = item.Times }); var subList = detailsList?.Where(qitem => qitem.CommentMainId == item.Id)?.ToList();
if (subList != null && subList.Count > 0) if (subList != null && subList.Count > 0)
{ {
var totalCount = subList.Count; var totalCount = subList.Count;
......
...@@ -441,9 +441,9 @@ namespace EduSpider.WebApi.Controllers ...@@ -441,9 +441,9 @@ namespace EduSpider.WebApi.Controllers
public ApiResult SetStuCommentShowTypeByTimes() public ApiResult SetStuCommentShowTypeByTimes()
{ {
int CourseId = base.ReqParameters.GetInt("CourseId"); int CourseId = base.ReqParameters.GetInt("CourseId");
int Times = base.ReqParameters.GetInt("Times"); int CommentMainId = base.ReqParameters.GetInt("CommentMainId");
int ShowType = base.ReqParameters.GetInt("ShowType"); int ShowType = base.ReqParameters.GetInt("ShowType");
var flag = CourseService.SetStuCommentShowTypeByTimes(CourseId, Times, ShowType); ; var flag = CourseService.SetStuCommentShowTypeByTimes(CourseId, CommentMainId, ShowType); ;
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
......
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