Commit bcda054a authored by liudong1993's avatar liudong1993

1

parent 9e8478ce
......@@ -185,6 +185,8 @@ namespace Mall.Module.Miai
int Sex = miai_BaseInfoRepository.GetBaseInfoList(new RB_MiAi_BaseInfo_Extend() { TenantId = userInfo.TenantId, UserId = model.UserId }).FirstOrDefault()?.Sex ?? 0;
//查询当前用户是否已关注
bool IsFocus = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend() { TenantId = userInfo.TenantId, UserId = model.UserId, CreateBy = userInfo.UserId }).Any();
//查询是否已关注我
bool IsFocus2 = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend() { TenantId = userInfo.TenantId, UserId = userInfo.UserId, CreateBy = model.UserId }).Any();
return new
{
model.Id,
......@@ -200,7 +202,7 @@ namespace Mall.Module.Miai
CreateDate = model.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
PeopleNum,
IsEnroll,
IsFocus,
IsFocus = IsFocus == true && IsFocus2 == true ? 2 : IsFocus == true ? 1 : 0,
ReplyNum = rlist.FirstOrDefault()?.ReplyNum ?? 0
};
}
......@@ -539,8 +541,13 @@ namespace Mall.Module.Miai
string UserIds = string.Join(",", list.Select(x => x.UserId).Distinct());
//查询当前用户是否已关注
var flist = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend() { TenantId = userInfo.TenantId, UserIds= UserIds, CreateBy = userInfo.UserId });
//查询是否已关注我
var flist2 = miai_FollowMemberRepository.GetFollowMemberList(new RB_MiAi_FollowMember_Extend() { TenantId = userInfo.TenantId, UserId = userInfo.UserId, CreateByIds = UserIds });
foreach (var item in list) {
item.IsFocus = flist.Where(x => x.UserId == item.UserId).Any() ? 1 : 2;
item.IsFocus = flist.Where(x => x.UserId == item.UserId).Any() ? 1 : 0;
if (flist2.Where(x => x.CreateBy == item.UserId).Any() && item.IsFocus == 1) {
item.IsFocus = 2;
}
}
}
return list;
......
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