Commit 15cbfc16 authored by 黄奎's avatar 黄奎

页面修改

parent d7ee7a30
...@@ -3,7 +3,9 @@ using System.Collections.Generic; ...@@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Extend.MarketingCenter; using Mall.Model.Extend.MarketingCenter;
using Mall.Model.Extend.User;
using Mall.Repository.MarketingCenter; using Mall.Repository.MarketingCenter;
using Mall.Repository.User;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using VT.FW.DB; using VT.FW.DB;
...@@ -21,6 +23,8 @@ namespace Mall.Module.MarketingCenter ...@@ -21,6 +23,8 @@ namespace Mall.Module.MarketingCenter
private readonly RB_Miniprogram_TemplateRepository miniprogram_TemplateRepository = new RB_Miniprogram_TemplateRepository(); private readonly RB_Miniprogram_TemplateRepository miniprogram_TemplateRepository = new RB_Miniprogram_TemplateRepository();
private readonly Repository.Miai.RB_MiAi_BaseInfoRepository miai_BaseInfoRepository = new Repository.Miai.RB_MiAi_BaseInfoRepository(); private readonly Repository.Miai.RB_MiAi_BaseInfoRepository miai_BaseInfoRepository = new Repository.Miai.RB_MiAi_BaseInfoRepository();
private readonly Repository.Miai.RB_MiAi_BaseInfoQueryRepository miai_BaseInfoQueryRepository = new Repository.Miai.RB_MiAi_BaseInfoQueryRepository(); private readonly Repository.Miai.RB_MiAi_BaseInfoQueryRepository miai_BaseInfoQueryRepository = new Repository.Miai.RB_MiAi_BaseInfoQueryRepository();
/// <summary> /// <summary>
/// 小程序模板分页列表 /// 小程序模板分页列表
/// </summary> /// </summary>
...@@ -643,8 +647,11 @@ namespace Mall.Module.MarketingCenter ...@@ -643,8 +647,11 @@ namespace Mall.Module.MarketingCenter
miaiUserItem.list = driveData.list; miaiUserItem.list = driveData.list;
int Sex = 0; int Sex = 0;
int Age = 0; int Age = 0;
string userGroupIds = "";//用户所在的分组
if (UserId > 0)//说明用户登录了的 if (UserId > 0)//说明用户登录了的
{ {
var userInfo = new RB_Member_UserRepository().GetMemberUserEntityRepository(new RB_Member_User_Extend() { Id = UserId });
userGroupIds = userInfo?.BelongGroupIds;
//查看用户的 //查看用户的
var baseInfo = miai_BaseInfoRepository.GetBaseInfoList(new Model.Extend.Miai.RB_MiAi_BaseInfo_Extend { TenantId = TenantId, MallBaseId = MallBaseId, UserId = UserId }).FirstOrDefault(); var baseInfo = miai_BaseInfoRepository.GetBaseInfoList(new Model.Extend.Miai.RB_MiAi_BaseInfo_Extend { TenantId = TenantId, MallBaseId = MallBaseId, UserId = UserId }).FirstOrDefault();
if (baseInfo != null) if (baseInfo != null)
...@@ -681,7 +688,8 @@ namespace Mall.Module.MarketingCenter ...@@ -681,7 +688,8 @@ namespace Mall.Module.MarketingCenter
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
UserIds = Ids, UserIds = Ids,
UserId = UserId UserId = UserId,
UserGroupIds= userGroupIds,
}); });
List<miaiUserDetail> newGoodsList = new List<miaiUserDetail>(); List<miaiUserDetail> newGoodsList = new List<miaiUserDetail>();
foreach (var goodItem in miaiUserItem.list) foreach (var goodItem in miaiUserItem.list)
...@@ -716,10 +724,9 @@ namespace Mall.Module.MarketingCenter ...@@ -716,10 +724,9 @@ namespace Mall.Module.MarketingCenter
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
UserId = UserId, UserId = UserId,
Sex = Sex Sex = Sex,
UserGroupIds = userGroupIds,
}; };
if (Sex > 0) if (Sex > 0)
{ {
var queryBaseInfoModel = miai_BaseInfoQueryRepository.GetBaseInfoQueryList(new Model.Entity.Miai.RB_MiAi_BaseInfoQuery var queryBaseInfoModel = miai_BaseInfoQueryRepository.GetBaseInfoQueryList(new Model.Entity.Miai.RB_MiAi_BaseInfoQuery
...@@ -752,7 +759,6 @@ namespace Mall.Module.MarketingCenter ...@@ -752,7 +759,6 @@ namespace Mall.Module.MarketingCenter
foreach (var tempGood in tempGoodsList) foreach (var tempGood in tempGoodsList)
{ {
var lastItem = new miaiUserDetail(); var lastItem = new miaiUserDetail();
// var tempGood = tempGoodsList?.Where(qitem => qitem.UserId == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0) if (tempGood != null && tempGood.Id > 0)
{ {
lastItem.id = tempGood.UserId; lastItem.id = tempGood.UserId;
...@@ -783,6 +789,7 @@ namespace Mall.Module.MarketingCenter ...@@ -783,6 +789,7 @@ namespace Mall.Module.MarketingCenter
Sort = 2, Sort = 2,
Sex = Sex, Sex = Sex,
UserId = UserId, UserId = UserId,
UserGroupIds = userGroupIds,
FollowRate = miaiUserItem.FollowRate == 0 ? 1 : miaiUserItem.FollowRate, FollowRate = miaiUserItem.FollowRate == 0 ? 1 : miaiUserItem.FollowRate,
BrowseRate = miaiUserItem.BrowseRate == 0 ? 1 : miaiUserItem.BrowseRate, BrowseRate = miaiUserItem.BrowseRate == 0 ? 1 : miaiUserItem.BrowseRate,
}); });
...@@ -821,13 +828,13 @@ namespace Mall.Module.MarketingCenter ...@@ -821,13 +828,13 @@ namespace Mall.Module.MarketingCenter
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
Sort = 3, Sort = 3,
Sex = Sex, Sex = Sex,
UserId = UserId UserId = UserId,
UserGroupIds = userGroupIds,
}); });
List<miaiUserDetail> newGoodsList = new List<miaiUserDetail>(); List<miaiUserDetail> newGoodsList = new List<miaiUserDetail>();
foreach (var tempGood in tempGoodsList) foreach (var tempGood in tempGoodsList)
{ {
var lastItem = new miaiUserDetail(); var lastItem = new miaiUserDetail();
// var tempGood = tempGoodsList?.Where(qitem => qitem.UserId == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0) if (tempGood != null && tempGood.Id > 0)
{ {
lastItem.id = tempGood.UserId; lastItem.id = tempGood.UserId;
...@@ -848,7 +855,6 @@ namespace Mall.Module.MarketingCenter ...@@ -848,7 +855,6 @@ namespace Mall.Module.MarketingCenter
} }
miaiUserItem.list = newGoodsList; miaiUserItem.list = newGoodsList;
} }
} }
else else
{ {
......
...@@ -283,7 +283,7 @@ WHERE a.Status=0 and b.Blacklist!=1 "); ...@@ -283,7 +283,7 @@ WHERE a.Status=0 and b.Blacklist!=1 ");
{ {
tempStr += " OR "; tempStr += " OR ";
} }
tempStr += string.Join(" FIND_IN_SET('{0}',b.BelongGroupIds) ", groupIdList[i]); tempStr += string.Format(" FIND_IN_SET('{0}',b.BelongGroupIds) ", groupIdList[i]);
} }
if (!string.IsNullOrEmpty(tempStr)) if (!string.IsNullOrEmpty(tempStr))
{ {
...@@ -370,7 +370,7 @@ WHERE a.Status=0 AND b.Blacklist!=1 "); ...@@ -370,7 +370,7 @@ WHERE a.Status=0 AND b.Blacklist!=1 ");
{ {
tempStr += " OR "; tempStr += " OR ";
} }
tempStr += string.Join(" FIND_IN_SET('{0}',b.BelongGroupIds) ", groupIdList[i]); tempStr += string.Format(" FIND_IN_SET('{0}',b.BelongGroupIds) ", groupIdList[i]);
} }
if (!string.IsNullOrEmpty(tempStr)) if (!string.IsNullOrEmpty(tempStr))
{ {
...@@ -465,7 +465,7 @@ WHERE 1=1"); ...@@ -465,7 +465,7 @@ WHERE 1=1");
{ {
tempStr += " OR "; tempStr += " OR ";
} }
tempStr += string.Join(" FIND_IN_SET('{0}',a.BelongGroupIds) ", groupIdList[i]); tempStr += string.Format(" FIND_IN_SET('{0}',a.BelongGroupIds) ", groupIdList[i]);
} }
if (!string.IsNullOrEmpty(tempStr)) if (!string.IsNullOrEmpty(tempStr))
{ {
......
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