Commit 92ee5251 authored by 吴春's avatar 吴春

提交代码

parent 4932a11d
......@@ -23,6 +23,16 @@ namespace Mall.Model.Entity.Miai
set;
}
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 用户头像
/// </summary>
public int UserPhoto { get; set; }
/// <summary>
/// 活动id
/// </summary>
......
......@@ -3408,6 +3408,10 @@ namespace Mall.Model.Extend.MarketingCenter
public int listStyle { get; set; }
/// <summary>
/// 背景色
/// </summary>
public string backgroundColor { get; set; }
/// <summary>
/// 展示样式
......@@ -3454,6 +3458,8 @@ namespace Mall.Model.Extend.MarketingCenter
public string CreateBy { get; set; }
/// <summary>
/// 发帖人
/// </summary>
......
......@@ -19,10 +19,9 @@ namespace Mall.Model.Extend.Miai
public string ActivityIds { get; set; }
/// <summary>
/// 用户名
/// 用户名
/// </summary>
public string UserName { get; set; }
public string CreateByUserName { get; set; }
/// <summary>
/// 用户头像
/// </summary>
......
......@@ -14,6 +14,7 @@ using Mall.Model.Entity.Education;
using Mall.Repository.TradePavilion;
using Mall.Repository.Education;
using Mall.Model.Entity.Miai;
using Mall.Repository.Product;
namespace Mall.Module.Miai
{
......@@ -79,7 +80,10 @@ namespace Mall.Module.Miai
/// 区域
/// </summary>
private readonly Repository.BaseSetUp.Rb_destinationRepository destinationRepository = new Repository.BaseSetUp.Rb_destinationRepository();
/// <summary>
/// 素材管理
/// </summary>
private readonly RB_Material_InfoRepository material_InfoRepository = new RB_Material_InfoRepository();
private readonly RB_MiAi_BaseInfoQueryRepository miAiBaseInfoQueryRepository = new RB_MiAi_BaseInfoQueryRepository();
private readonly RB_MiAi_BaseInfoDayQueryRepository miAiBaseInfoDayQueryRepository = new RB_MiAi_BaseInfoDayQueryRepository();
......@@ -1015,6 +1019,14 @@ namespace Mall.Module.Miai
{
qitem.ImageList = JsonConvert.DeserializeObject<List<string>>(qitem.Images);
}
if (qitem.UserId == 0 && qitem.UserPhoto > 0)
{
qitem.Photo = material_InfoRepository.GetEntity(qitem.UserPhoto)?.Path ?? "";
}
}
if (item.UserId == 0 && item.UserPhoto > 0)
{
item.Photo = material_InfoRepository.GetEntity(item.UserPhoto)?.Path ?? "";
}
}
}
......@@ -1051,6 +1063,10 @@ namespace Mall.Module.Miai
{
qitem.ImageList = JsonConvert.DeserializeObject<List<string>>(qitem.Images);
}
if (qitem.UserId == 0 && qitem.UserPhoto > 0)
{
qitem.Photo = material_InfoRepository.GetEntity(qitem.UserPhoto)?.Path ?? "";
}
}
return list;
}
......@@ -1087,7 +1103,7 @@ namespace Mall.Module.Miai
if (flag)
{
var model = miai_ActivityRepository.GetEntity(demodel.ActivityId);
if (model != null && model.UserId != demodel.UserId)
if (model != null && model.UserId != demodel.UserId && demodel.UserId > 0)
{
if (demodel.ReplyUserId == 0)
{
......
......@@ -53,7 +53,7 @@ namespace Mall.Repository.Miai
where += $@" and d.{nameof(RB_Miai_ActivityDiscuss_Extend.ParentId)} =0";
}
string sql = $@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,b.Sex,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
string sql = $@"select d.*,u.Name as CreateByUserName,u.Photo,u1.Name as ReplyUserName,b.Sex,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.Id
left join rb_miai_baseinfo b on d.UserId =b.UserId
......@@ -120,7 +120,7 @@ where {where} order by d.Id desc";
if (count == 1)
{
//只有一条数据
sql = $@"select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
sql = $@"select d.*,u.Name as CreateByUserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.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
......@@ -133,7 +133,7 @@ where d.Status =0 and d.ParentId ={pidsList.FirstOrDefault()} order by d.Id desc
if (i == count - 1)
{
//最后一条
sql += $@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
sql += $@"(select d.*,u.Name as CreateByUserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.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
......@@ -141,7 +141,7 @@ where d.Status =0 and d.ParentId ={pidsList[i]} order by d.Id desc limit {number
}
else
{
sql += $@"(select d.*,u.Name as UserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
sql += $@"(select d.*,u.Name as CreateByUserName,u.Photo,u1.Name as ReplyUserName,IFNULL(dz.DianZanNum,0) as DianZanNum from RB_Miai_ActivityDiscuss d
left join rb_member_user u on d.UserId = u.Id
left join rb_member_user u1 on d.ReplyUserId = u1.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
......
......@@ -76,6 +76,23 @@ namespace Mall.WebApi.Controllers.MallBase
RB_Miai_Activity_Extend demodel = JsonConvert.DeserializeObject<RB_Miai_Activity_Extend>(parms.msg.ToString());
demodel.MallBaseId = parms.MallBaseId;
var list = miaiModule.GetActivityPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
foreach (var item in list)
{
string[] imgContent = HtmlHelper.GetHtmlImageUrlList(item.Content);
string tempContent = HtmlHelper.StripHT(item.Content);
if (!string.IsNullOrWhiteSpace(tempContent))
{
item.Content = tempContent;
}
else if (imgContent != null && imgContent.Any())
{
item.Content = "【多图】";
}
else
{
item.Content = "";
}
}
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
......@@ -580,7 +597,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
x.Id,
x.UserId,
x.UserName,
UserName= !string.IsNullOrWhiteSpace(x.CreateByUserName) ? x.CreateByUserName : x.UserName,
x.Photo,
x.Sex,
x.Content,
......@@ -590,7 +607,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
z.Id,
z.UserId,
z.UserName,
UserName = !string.IsNullOrWhiteSpace(z.CreateByUserName) ? z.CreateByUserName : z.UserName,
z.Photo,
z.Content,
z.ImageList,
......
......@@ -264,7 +264,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
x.Id,
x.UserId,
x.UserName,
UserName = !string.IsNullOrWhiteSpace(x.CreateByUserName) ? x.CreateByUserName : x.UserName,
x.Photo,
x.Content,
x.ImageList,
......@@ -272,7 +272,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
z.Id,
z.UserId,
z.UserName,
UserName = !string.IsNullOrWhiteSpace(z.CreateByUserName) ? z.CreateByUserName : z.UserName,
z.Photo,
z.Content,
z.ImageList,
......@@ -308,7 +308,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
x.Id,
x.UserId,
x.UserName,
UserName = !string.IsNullOrWhiteSpace(x.CreateByUserName) ? x.CreateByUserName : x.UserName,
x.Photo,
x.Content,
x.ImageList,
......@@ -344,6 +344,50 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 设置评论
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SgetActivityDiscussInfo()
{
var parms = RequestParm;
RB_Miai_ActivityDiscuss_Extend demodel = JsonConvert.DeserializeObject<RB_Miai_ActivityDiscuss_Extend>(parms.msg.ToString());
if (demodel.ActivityId <= 0)
{
return ApiResult.ParamIsNull("请传递活动id");
}
if (string.IsNullOrEmpty(demodel.UserName))
{
return ApiResult.ParamIsNull("请输入用户名称");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请传递内容");
}
demodel.ImageList ??= new List<string>();
demodel.Images = JsonConvert.SerializeObject(demodel.ImageList);
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.Status = 0;
// demodel.CreateDate = DateTime.Now;
demodel.UpdateDate = DateTime.Now;
bool flag = miaiModule.SetActivityDiscussInfo(demodel);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
/// <summary>
/// 获取活动报名分页列表
/// </summary>
......
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