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

提交代码

parent 34dd276f
...@@ -18,7 +18,7 @@ namespace Mall.Module.Education ...@@ -18,7 +18,7 @@ namespace Mall.Module.Education
/// </summary> /// </summary>
private readonly RB_Education_TeacherRepository educationTeacherRepository = new RB_Education_TeacherRepository(); private readonly RB_Education_TeacherRepository educationTeacherRepository = new RB_Education_TeacherRepository();
private readonly RB_Education_CouponRepository discountCouponRepository = new RB_Education_CouponRepository(); private readonly RB_Education_CouponRepository discountCouponRepository = new RB_Education_CouponRepository();
private readonly RB_Education_CouponProductRepository productRepository = new RB_Education_CouponProductRepository(); private readonly RB_Education_CouponProductRepository productRepository = new RB_Education_CouponProductRepository();
...@@ -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>
///教师配置列表 ///教师配置列表
...@@ -283,7 +289,7 @@ namespace Mall.Module.Education ...@@ -283,7 +289,7 @@ namespace Mall.Module.Education
new WhereHelper (){ FiledName=nameof(RB_Education_CouponProduct.CouponId),FiledValue=id,OperatorEnum=OperatorEnum.Equal} new WhereHelper (){ FiledName=nameof(RB_Education_CouponProduct.CouponId),FiledValue=id,OperatorEnum=OperatorEnum.Equal}
}; };
productRepository.Update(fileds, whereHelpers, trans); productRepository.Update(fileds, whereHelpers, trans);
if (model.ProductList != null && model.ProductList.Any()) if (model.ProductList != null && model.ProductList.Any())
{ {
model.ProductList.ForEach(x => x.DiscountCouponType = model.UseType); model.ProductList.ForEach(x => x.DiscountCouponType = model.UseType);
...@@ -651,7 +657,7 @@ namespace Mall.Module.Education ...@@ -651,7 +657,7 @@ namespace Mall.Module.Education
{ {
id = model.ID; id = model.ID;
flag = selfMotionRepository.Update(model, trans); flag = selfMotionRepository.Update(model, trans);
IDictionary<string, object> fileds = new Dictionary<string, object>() IDictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Education_CouponSelfMotionMember.Status),1}, { nameof(RB_Education_CouponSelfMotionMember.Status),1},
...@@ -961,7 +967,7 @@ namespace Mall.Module.Education ...@@ -961,7 +967,7 @@ namespace Mall.Module.Education
/// <param name="gradeId"></param> /// <param name="gradeId"></param>
/// <param name="uid"></param> /// <param name="uid"></param>
/// <returns></returns> /// <returns></returns>
public bool DelArticleInfo(List<string> ids, int uid, int mallBaseId) public bool DelArticleInfo(List<string> ids, int uid, int mallBaseId)
{ {
var trans = educationArticleRepository.DbTransaction; var trans = educationArticleRepository.DbTransaction;
bool flag = false; bool flag = false;
...@@ -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