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

页面修改

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