Commit 01839bcb authored by 吴春's avatar 吴春

Merge branch 'sdzq-ld' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq

parents 376c0356 bcda054a
......@@ -203,6 +203,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,
......@@ -218,7 +220,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
};
}
......@@ -557,8 +559,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