Commit 75d62059 authored by liudong1993's avatar liudong1993

相亲消息提醒

parent a61a6db9
...@@ -13,6 +13,9 @@ namespace Mall.Model.Extend.Miai ...@@ -13,6 +13,9 @@ namespace Mall.Model.Extend.Miai
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_Miai_Message_Extend : RB_Miai_Message public class RB_Miai_Message_Extend : RB_Miai_Message
{ {
/// <summary>
/// 查询类型 1圈子 2拼拼plus 3访客 4系统消息
/// </summary>
public int SelectType { get; set; }
} }
} }
...@@ -85,7 +85,19 @@ namespace Mall.Module.Miai ...@@ -85,7 +85,19 @@ namespace Mall.Module.Miai
/// <returns></returns> /// <returns></returns>
public List<RB_Miai_Message_Extend> GetMiaiMessagePageList(int pageIndex, int pageSize, out long count, RB_Miai_Message_Extend demodel) public List<RB_Miai_Message_Extend> GetMiaiMessagePageList(int pageIndex, int pageSize, out long count, RB_Miai_Message_Extend demodel)
{ {
return miaiCommonModule.GetPageList(pageIndex, pageSize, out count, demodel); var list = miaiCommonModule.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
//每种类型 额外返回数据
var activityList = list.Where(x => x.Type == Common.Enum.MiAi.MessageTypeEnum.SpellEnroll || x.Type == Common.Enum.MiAi.MessageTypeEnum.SpellEnrollCancel
|| x.Type == Common.Enum.MiAi.MessageTypeEnum.SpellComment || x.Type == Common.Enum.MiAi.MessageTypeEnum.SpellReply).ToList();
if (activityList.Any()) {
string ActivityIds = string.Join(",", activityList.Select(x => x.SourceId).Distinct());
var alist = miai_ActivityRepository.GetList(new RB_Miai_Activity_Extend() { TenantId = demodel.TenantId, ActivityIds = ActivityIds });
}
}
return list;
} }
/// <summary> /// <summary>
......
...@@ -86,6 +86,10 @@ namespace Mall.Repository.Miai ...@@ -86,6 +86,10 @@ namespace Mall.Repository.Miai
{ {
sb.AppendFormat(" and b.Name like'%{0}%'", where.Name); sb.AppendFormat(" and b.Name like'%{0}%'", where.Name);
} }
if (where.Sex > 0)
{
sb.AppendFormat(" and a.Sex ={0}", where.Sex);
}
} }
return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList(); return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
} }
......
...@@ -43,6 +43,24 @@ namespace Mall.Repository.Miai ...@@ -43,6 +43,24 @@ namespace Mall.Repository.Miai
{ {
where += $@" and {nameof(RB_Miai_Message_Extend.Type)} ={(int)dmodel.Type}"; where += $@" and {nameof(RB_Miai_Message_Extend.Type)} ={(int)dmodel.Type}";
} }
if (dmodel.SelectType > 0)
{
switch (dmodel.SelectType)
{
case 1:
where += $@" and Type in (1,2)";
break;
case 2:
where += $@" and Type in (3,4,5,6)";
break;
case 3:
where += $@" and Type in (7)";
break;
case 4:
where += $@" and Type in (8,9)";
break;
}
}
string sql = $@"select * from RB_Miai_Message where {where} order by Id desc"; string sql = $@"select * from RB_Miai_Message where {where} order by Id desc";
return GetPage<RB_Miai_Message_Extend>(pageIndex, pageSize, out rowCount, sql).ToList(); return GetPage<RB_Miai_Message_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
...@@ -124,6 +142,24 @@ namespace Mall.Repository.Miai ...@@ -124,6 +142,24 @@ namespace Mall.Repository.Miai
{ {
where += $@" and {nameof(RB_Miai_Message_Extend.Type)} ={(int)dmodel.Type}"; where += $@" and {nameof(RB_Miai_Message_Extend.Type)} ={(int)dmodel.Type}";
} }
if (dmodel.SelectType > 0)
{
switch (dmodel.SelectType)
{
case 1:
where += $@" and Type in (1,2)";
break;
case 2:
where += $@" and Type in (3,4,5,6)";
break;
case 3:
where += $@" and Type in (7)";
break;
case 4:
where += $@" and Type in (8,9)";
break;
}
}
string sql = $@"select count(0) from RB_Miai_Message where {where} "; string sql = $@"select count(0) from RB_Miai_Message where {where} ";
var obj = ExecuteScalar(sql); var obj = ExecuteScalar(sql);
......
...@@ -627,6 +627,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -627,6 +627,10 @@ namespace Mall.WebApi.Controllers.MallBase
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 批量删除消息
/// </summary>
/// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult DelMiaiMessageInfoBatch() public ApiResult DelMiaiMessageInfoBatch()
{ {
......
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