Commit e787c30c authored by 吴春's avatar 吴春

提交代码

parent 4a0209fc
...@@ -110,5 +110,10 @@ namespace Mall.Model.Extend.Miai ...@@ -110,5 +110,10 @@ namespace Mall.Model.Extend.Miai
/// </summary> /// </summary>
public int CommentId { get; set; } public int CommentId { get; set; }
/// <summary>
/// 评论人头像
/// </summary>
public string UserPhoto { get; set; }
} }
} }
...@@ -585,11 +585,16 @@ namespace Mall.Module.Miai ...@@ -585,11 +585,16 @@ namespace Mall.Module.Miai
{ {
foreach (var itemComment in commentList) foreach (var itemComment in commentList)
{ {
if (itemComment.UserId == 0 && itemComment.UserPhoto > 0)
{
itemComment.Photo = material_InfoRepository.GetEntity(itemComment.UserPhoto)?.Path ?? "";
}
HotComment commentModel = new HotComment() HotComment commentModel = new HotComment()
{ {
DianZanNum = itemComment.DianZanNum, DianZanNum = itemComment.DianZanNum,
Comment = itemComment.Content, Comment = itemComment.Content,
CommentId = itemComment.Id CommentId = itemComment.Id,
UserPhoto = itemComment.Photo
}; };
item.HotCommentList.Add(commentModel); item.HotCommentList.Add(commentModel);
} }
...@@ -636,11 +641,16 @@ namespace Mall.Module.Miai ...@@ -636,11 +641,16 @@ namespace Mall.Module.Miai
{ {
foreach (var itemComment in commentList) foreach (var itemComment in commentList)
{ {
if (itemComment.UserId == 0 && itemComment.UserPhoto > 0)
{
itemComment.Photo = material_InfoRepository.GetEntity(itemComment.UserPhoto)?.Path ?? "";
}
HotComment commentModel = new HotComment() HotComment commentModel = new HotComment()
{ {
DianZanNum = itemComment.DianZanNum, DianZanNum = itemComment.DianZanNum,
Comment = itemComment.Content, Comment = itemComment.Content,
CommentId = itemComment.Id CommentId = itemComment.Id,
UserPhoto = itemComment.Photo
}; };
item.HotCommentList.Add(commentModel); item.HotCommentList.Add(commentModel);
} }
......
...@@ -265,7 +265,10 @@ namespace Mall.Module.TradePavilion ...@@ -265,7 +265,10 @@ namespace Mall.Module.TradePavilion
var blist = brand2Repository.GetBrandList(new RB_Brand_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, UserId = userId }); var blist = brand2Repository.GetBrandList(new RB_Brand_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, UserId = userId });
model.BrandModel = blist.FirstOrDefault().RefMapperTo<RB_BrandApplyFor_Extend>(); model.BrandModel = blist.FirstOrDefault().RefMapperTo<RB_BrandApplyFor_Extend>();
if (model.BrandModel != null && !string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
if (model.BrandModel != null)
{
if (!string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
{ {
model.BrandModel.CustomerTypeInfo = new List<string>(); model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(",")) foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
...@@ -274,7 +277,6 @@ namespace Mall.Module.TradePavilion ...@@ -274,7 +277,6 @@ namespace Mall.Module.TradePavilion
} }
} }
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner)) if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{ {
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner); model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
...@@ -285,6 +287,14 @@ namespace Mall.Module.TradePavilion ...@@ -285,6 +287,14 @@ namespace Mall.Module.TradePavilion
} }
} }
else else
{
model.BrandModel = new RB_BrandApplyFor_Extend();
model.BrandModel.BannerList = new List<string>();
model.BrandModel.CustomerTypeInfo = new List<string>();
}
}
else
{ {
var clist = carrierRepository.GetCarrierList(new RB_Carrier_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, UserId = userId }); var clist = carrierRepository.GetCarrierList(new RB_Carrier_Extend() { TenantId = model.TenantId, MallBaseId = model.MallBaseId, UserId = userId });
if (clist.Any()) if (clist.Any())
...@@ -315,7 +325,9 @@ namespace Mall.Module.TradePavilion ...@@ -315,7 +325,9 @@ namespace Mall.Module.TradePavilion
if (brandList != null && brandList.Any()) if (brandList != null && brandList.Any())
{ {
model.BrandModel = brandList.FirstOrDefault(); model.BrandModel = brandList.FirstOrDefault();
if (model.BrandModel != null && !string.IsNullOrWhiteSpace(model.BrandModel.CustomerType)) if (model.BrandModel != null)
{
if (!string.IsNullOrWhiteSpace(model.BrandModel.CustomerType))
{ {
model.BrandModel.CustomerTypeInfo = new List<string>(); model.BrandModel.CustomerTypeInfo = new List<string>();
foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(",")) foreach (var itemCustomerType in model.BrandModel.CustomerType.Split(","))
...@@ -323,7 +335,6 @@ namespace Mall.Module.TradePavilion ...@@ -323,7 +335,6 @@ namespace Mall.Module.TradePavilion
model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType)); model.BrandModel.CustomerTypeInfo.Add(Common.Plugin.EnumHelper.GetEnumName(itemCustomerType));
} }
} }
if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner)) if (!string.IsNullOrWhiteSpace(model.BrandModel.Banner))
{ {
model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner); model.BrandModel.BannerList = JsonConvert.DeserializeObject<List<string>>(model.BrandModel.Banner);
...@@ -333,6 +344,13 @@ namespace Mall.Module.TradePavilion ...@@ -333,6 +344,13 @@ namespace Mall.Module.TradePavilion
model.BrandModel.BannerList = new List<string>(); 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 else
{ {
......
...@@ -103,7 +103,9 @@ where {where} order by d.Id desc"; ...@@ -103,7 +103,9 @@ where {where} order by d.Id desc";
{ {
orderBy = " ORDER BY IFNULL(dz.DianZanNum, 0) desc,d.CreateDate 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(); 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