Commit 0149e98d authored by 黄奎's avatar 黄奎

页面修改

parent 76dfc5ed
......@@ -110,11 +110,45 @@ WHERE Status=0 and b.Blacklist!=1
public List<RB_MiAi_BaseInfo_Extend> GetFirstBaseInfoPageList_V2(int pageIndex, int pageSize, out long rowsCount, RB_MiaiMember_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from (SELECT c.*,b.`Name`,b.Photo ,(YEAR (curdate())- YEAR ( c.Birthday )- 1+ (DATE_FORMAT( c.Birthday, '%m%d' )<=(DATE_FORMAT( curdate(), '%m%d' )))) Age from RB_MiAi_BaseInfo as c
LEFT JOIN rb_member_user as b on c.UserId=b.Id where c.Status=0 and b.Blacklist!=1
) as a where 1=1");
sb.Append($@"
SELECT *
FROM
(
SELECT c.*,b.`Name`,b.Photo,b.BelongGroupIds,b.IsShow,(YEAR (curdate())- YEAR (c.Birthday )- 1+ (DATE_FORMAT( c.Birthday, '%m%d' )<=(DATE_FORMAT( curdate(), '%m%d' )))) Age
FROM RB_MiAi_BaseInfo as c LEFT JOIN rb_member_user as b on c.UserId=b.Id
WHERE c.Status=0 and b.Blacklist!=1
) as a
WHERE 1=1");
//HK 2021-10-28 新增
sb.Append(" and a.IsShow=1 ");
List<int> groupIdList = new List<int>();
if (!string.IsNullOrEmpty(where.UserGroupIds))
{
groupIdList = member_GroupRepository.GetLookGroupIdsRepository(new Model.Extend.User.RB_Member_Group_Extend()
{
TenantId = where.TenantId ?? 0,
MallBaseId = where.MallBaseId ?? 0,
Q_GroupIds = where.UserGroupIds,
});
}
if (where != null)
{
if (groupIdList != null && groupIdList.Count > 0)
{
string tempStr = "";
for (var i = 0; i < groupIdList.Count; i++)
{
if (i > 0)
{
tempStr += " OR ";
}
tempStr += string.Format(" FIND_IN_SET('{0}',a.BelongGroupIds) ", groupIdList[i]);
}
if (!string.IsNullOrEmpty(tempStr))
{
sb.AppendFormat(" and ({0})", tempStr);
}
}
if (where.TenantId > 0)
{
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
......@@ -377,6 +411,10 @@ WHERE a.Status=0 AND b.Blacklist!=1 ");
sb.AppendFormat(" and ({0})", tempStr);
}
}
if (!string.IsNullOrEmpty(where.LookGroupIds))
{
sb.AppendFormat(" AND FIND_IN_SET('{0}',b.BelongGroupIds) ", where.LookGroupIds);
}
if (where.TenantId > 0)
{
......
......@@ -1709,7 +1709,12 @@ namespace Mall.WebApi.Controllers.MallBase
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.UserId = parms.UserId;
var userModel = new RB_Member_User_Extend();
if (parms.UserId > 0)
{
userModel = miaiModule.GetMemberUserInfo(parms.UserId);
demodel.UserGroupIds = userModel?.BelongGroupIds;
}
var dayQueryModel = new RB_MiAi_BaseInfoDayQuery();
try
{
......@@ -1765,7 +1770,6 @@ namespace Mall.WebApi.Controllers.MallBase
foreach (var tempGood in list)
{
var lastItem = new Model.Extend.MarketingCenter.miaiUserDetail();
// var tempGood = tempGoodsList?.Where(qitem => qitem.UserId == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0)
{
lastItem.id = tempGood.UserId;
......@@ -2330,8 +2334,8 @@ namespace Mall.WebApi.Controllers.MallBase
});
}
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = result;
return ApiResult.Success(data: new { listStyle =1,list= result });
pageModel.pageData = new { listStyle = 1, list = result };
return ApiResult.Success(data: pageModel);
}
#endregion
}
......
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