Commit 2e22fd10 authored by 吴春's avatar 吴春

提交代码

parent 34dd276f
...@@ -35,10 +35,16 @@ namespace Mall.Module.Education ...@@ -35,10 +35,16 @@ namespace Mall.Module.Education
private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository(); private readonly RB_Member_UserRepository member_UserRepository = new RB_Member_UserRepository();
/// <summary> /// <summary>
/// 会员信息 /// 资讯
/// </summary> /// </summary>
private readonly RB_Education_ArticleRepository educationArticleRepository = new RB_Education_ArticleRepository(); private readonly RB_Education_ArticleRepository educationArticleRepository = new RB_Education_ArticleRepository();
/// <summary>
/// 资讯评论信息
/// </summary>
private readonly RB_Education_ArticleCommentRepository educationArticleCommentRepository = new RB_Education_ArticleCommentRepository();
#region 教师管理 #region 教师管理
/// <summary> /// <summary>
///教师配置列表 ///教师配置列表
...@@ -1008,5 +1014,20 @@ namespace Mall.Module.Education ...@@ -1008,5 +1014,20 @@ namespace Mall.Module.Education
} }
#endregion #endregion
#region 教育-资讯评论管理
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Education_ArticleComment_Extend> GetPageList(int pageIndex, int pageSize, out long count, RB_Education_ArticleComment_Extend dmodel)
{
return educationArticleCommentRepository.GetPageList(pageIndex, pageSize, out count, dmodel);
}
#endregion
} }
} }
using Mall.Model.Entity.Education; using Mall.Model.Entity.Education;
using Mall.Model.Extend.Education;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Mall.Repository.Education namespace Mall.Repository.Education
...@@ -11,5 +13,58 @@ namespace Mall.Repository.Education ...@@ -11,5 +13,58 @@ namespace Mall.Repository.Education
public class RB_Education_ArticleCommentRepository : BaseRepository<RB_Education_ArticleComment> public class RB_Education_ArticleCommentRepository : BaseRepository<RB_Education_ArticleComment>
{ {
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Education_ArticleComment); } }
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Education_ArticleComment_Extend> GetPageList(int pageIndex, int pageSize, out long count, RB_Education_ArticleComment_Extend dmodel)
{
string where = $" 1=1 and c.{nameof(RB_Education_ArticleComment.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and c.{nameof(RB_Education_ArticleComment.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and c.{nameof(RB_Education_ArticleComment.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.ID > 0)
{
where += $@" and c.{nameof(RB_Education_ArticleComment.ID)}={dmodel.ID}";
}
if (dmodel.CommentGrade > 0)
{
where += $@" and c.{nameof(RB_Education_ArticleComment.CommentGrade)}={(int)dmodel.CommentGrade}";
}
if (dmodel.PlatformSource > 0)
{
where += $@" and c.{nameof(RB_Education_ArticleComment.PlatformSource)}={(int)dmodel.PlatformSource}";
}
if (!string.IsNullOrEmpty(dmodel.UserName))
{
where += $@" and c.{nameof(RB_Education_ArticleComment.UserName)} like '%{dmodel.UserName}%'";
}
if (!string.IsNullOrEmpty(dmodel.ArticleName))
{
where += $@" and g.{nameof(RB_Education_Article.Name)} like '%{dmodel.ArticleName}%'";
}
if (!string.IsNullOrEmpty(dmodel.Content))
{
where += $@" and c.{nameof(RB_Education_ArticleComment.Content)} like '%{dmodel.Content}%'";
}
string sql = $@"SELECT c.*,g.Name as ArticleName FROM {TableName} c
left join rb_education_article g on c.ArticleId = g.Id
where {where} order by c.Id desc";
return GetPage<RB_Education_ArticleComment_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
} }
} }
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