Commit e787c30c authored by 吴春's avatar 吴春

提交代码

parent 4a0209fc
......@@ -110,5 +110,10 @@ namespace Mall.Model.Extend.Miai
/// </summary>
public int CommentId { get; set; }
/// <summary>
/// 评论人头像
/// </summary>
public string UserPhoto { get; set; }
}
}
......@@ -585,11 +585,16 @@ namespace Mall.Module.Miai
{
foreach (var itemComment in commentList)
{
if (itemComment.UserId == 0 && itemComment.UserPhoto > 0)
{
itemComment.Photo = material_InfoRepository.GetEntity(itemComment.UserPhoto)?.Path ?? "";
}
HotComment commentModel = new HotComment()
{
DianZanNum = itemComment.DianZanNum,
Comment = itemComment.Content,
CommentId = itemComment.Id
CommentId = itemComment.Id,
UserPhoto = itemComment.Photo
};
item.HotCommentList.Add(commentModel);
}
......@@ -636,11 +641,16 @@ namespace Mall.Module.Miai
{
foreach (var itemComment in commentList)
{
if (itemComment.UserId == 0 && itemComment.UserPhoto > 0)
{
itemComment.Photo = material_InfoRepository.GetEntity(itemComment.UserPhoto)?.Path ?? "";
}
HotComment commentModel = new HotComment()
{
DianZanNum = itemComment.DianZanNum,
Comment = itemComment.Content,
CommentId = itemComment.Id
CommentId = itemComment.Id,
UserPhoto = itemComment.Photo
};
item.HotCommentList.Add(commentModel);
}
......
......@@ -265,24 +265,34 @@ namespace Mall.Module.TradePavilion
var blist = brand2Repository.GetBrandList(new RB_Brand_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, UserId = userId });
model.BrandModel = blist.FirstOrDefault().RefMapperTo<RB_BrandApplyFor_Extend>();
if (model.BrandModel != null && !string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
if (model.BrandModel != null)
{
model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
if (!string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
{
model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType));
model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
{
model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType));
}
}
}
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
}
else
{
model.BrandModel.BannerList = new List<string>();
}
}
else
{
model.BrandModel = new RB_BrandApplyFor_Extend();
model.BrandModel.BannerList = new List<string>();
model.BrandModel.CustomerTypeInfo = new List<string>();
}
}
else
{
......@@ -315,22 +325,30 @@ namespace Mall.Module.TradePavilion
if (brandList != null && brandList.Any())
{
model.BrandModel = brandList.FirstOrDefault();
if (model.BrandModel != null && !string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
if (model.BrandModel != null)
{
model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
if (!string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
{
model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType));
model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
{
model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType));
}
}
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
}
else
{
model.BrandModel.BannerList = new List<string>();
}
}
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
}
else
{
model.BrandModel = new RB_BrandApplyFor_Extend();
model.BrandModel.BannerList = new List<string>();
model.BrandModel.CustomerTypeInfo = new List<string>();
}
}
}
......
......@@ -103,7 +103,9 @@ where {where} order by d.Id desc";
{
orderBy = " ORDER BY IFNULL(dz.DianZanNum, 0) desc,d.CreateDate desc";
}
string sql = $@"select d.*,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss as d LEFT JOIN (SELECT ActivityDiscussId,COUNT(*) DianZanNum from rb_miai_dianzan where `Status`=0 and ActivityId>0 and ActivityDiscussId>0 GROUP BY ActivityDiscussId) as dz on dz.ActivityDiscussId=d.Id where {where} {orderBy}";
string sql = $@"select d.*,u.Photo,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss as d
left join rb_member_user u on d.UserId = u.Id
LEFT JOIN (SELECT ActivityDiscussId,COUNT(*) DianZanNum from rb_miai_dianzan where `Status`=0 and ActivityId>0 and ActivityDiscussId>0 GROUP BY ActivityDiscussId) as dz on dz.ActivityDiscussId=d.Id where {where} {orderBy}";
return Get<RB_Miai_ActivityDiscuss_Extend>(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