Commit e7ca1dad authored by 吴春's avatar 吴春

提交代码

parent b7a590e9
......@@ -40,5 +40,6 @@ namespace Mall.Model.Extend.Miai
/// 关注权重
/// </summary>
public decimal FollowRate { get; set; }
}
}
......@@ -59,24 +59,32 @@ namespace Mall.Repository.Miai
public List<RB_MiAi_BaseInfo_Extend> GetBaseInfoPageList(int pageIndex, int pageSize, out long rowsCount, RB_MiAi_BaseInfo_Extend where)
{
StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_MiAi_BaseInfo where Status=0");
sb.Append($@"SELECT a.*,b.`Name`,b.Photo from RB_MiAi_BaseInfo as a LEFT JOIN rb_member_user as b on a.UserId=b.Id where Status=0 and b.Blacklist!=1");
if (where != null)
{
if (where.TenantId > 0)
{
sb.AppendFormat(" and TenantId={0}", where.TenantId);
sb.AppendFormat(" and a.TenantId={0}", where.TenantId);
}
if (where.MallBaseId > 0)
{
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId);
sb.AppendFormat(" and a.MallBaseId={0}", where.MallBaseId);
}
if (where.Id > 0)
{
sb.AppendFormat(" and Id={0}", where.Id);
sb.AppendFormat(" and a.Id={0}", where.Id);
}
if (where.UserId > 0)
{
sb.AppendFormat(" and UserId={0}", where.UserId);
sb.AppendFormat(" and a.UserId={0}", where.UserId);
}
if (!string.IsNullOrWhiteSpace(where.RealName))
{
sb.AppendFormat(" and a.RealName like'%{0}%'", where.RealName);
}
if (!string.IsNullOrWhiteSpace(where.Name))
{
sb.AppendFormat(" and b.Name like'%{0}%'", where.Name);
}
}
return GetPage<RB_MiAi_BaseInfo_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
......
......@@ -33,7 +33,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetForumPageList() {
public ApiResult GetForumPageList()
{
var req = base.RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_Miai_Forum_Extend demodel = JsonConvert.DeserializeObject<RB_Miai_Forum_Extend>(req.msg.ToString());
......@@ -59,14 +60,16 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetForumInfo() {
public ApiResult SetForumInfo()
{
var req = base.RequestParm;
RB_Miai_Forum_Extend demodel = JsonConvert.DeserializeObject<RB_Miai_Forum_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name))
{
return ApiResult.ParamIsNull("请输入版块名称");
}
if (string.IsNullOrEmpty(demodel.Icon)) {
if (string.IsNullOrEmpty(demodel.Icon))
{
return ApiResult.ParamIsNull("请选择版块图标");
}
......@@ -81,7 +84,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed();
}
}
......@@ -91,7 +95,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetForumState() {
public ApiResult SetForumState()
{
var req = base.RequestParm;
var parms = JObject.Parse(req.msg.ToString());
int ForumId = parms.GetInt("ForumId", 0);
......@@ -211,7 +216,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.Photo,
x.Content,
x.ImageList,
ReplyList = x.ReplyList.Select(z => new {
ReplyList = x.ReplyList.Select(z => new
{
z.Id,
z.UserId,
z.UserName,
......@@ -500,6 +506,35 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Failed("用户暂未认证");
}
}
[HttpPost]
public ApiResult GetBaseInfoPageList()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
RB_MiAi_BaseInfo_Extend demodel = JsonConvert.DeserializeObject<RB_MiAi_BaseInfo_Extend>(RequestParm.msg.ToString());
demodel.TenantId = UserInfo.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = miaiModule.GetBaseInfoPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Name,
x.UserId,
x.Id,
x.RealName,
x.Photo,
SexStr = x.Sex == 1 ? "男" : (x.Sex == 2 ? "女" : ""),
x.Birthday,
x.Height,
x.Weight,
EducationType = EnumHelper.GetEnumName(x.EducationType),
Marriage = EnumHelper.GetEnumName(x.Marriage)
});
return ApiResult.Success("", pagelist);
}
#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