Commit 80a4e01b authored by 吴春's avatar 吴春

11

parent 379a692f
...@@ -170,5 +170,10 @@ namespace Mall.Common ...@@ -170,5 +170,10 @@ namespace Mall.Common
/// 用户UnionId /// 用户UnionId
/// </summary> /// </summary>
public string UserUnoinid { get; set; } public string UserUnoinid { get; set; }
/// <summary>
/// 获取电话号码
/// </summary>
public string PhoneNum { get; set; }
} }
} }
using Mall.WeChat.Common; using Newtonsoft.Json;
using Mall.Common.Pay.WeChatPat.Model;
using System;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using Newtonsoft.Json; using System;
namespace Mall.Common.Pay.WeChatPat namespace Mall.Common.Pay.WeChatPat
{ {
......
...@@ -190,6 +190,8 @@ namespace Mall.Common.Plugin ...@@ -190,6 +190,8 @@ namespace Mall.Common.Plugin
} }
} }
/// <summary> /// <summary>
/// 把响应流转换为文本。 /// 把响应流转换为文本。
/// </summary> /// </summary>
......
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using static QRCoder.PayloadGenerator;
namespace Mall.Common.Plugin namespace Mall.Common.Plugin
{ {
...@@ -40,7 +42,7 @@ namespace Mall.Common.Plugin ...@@ -40,7 +42,7 @@ namespace Mall.Common.Plugin
/// <param name="AppSecret"></param> /// <param name="AppSecret"></param>
/// <param name="Code"></param> /// <param name="Code"></param>
/// <returns></returns> /// <returns></returns>
public static MiniAppUserCache GetWeChatOpenId(string AppId, string AppSecret, string Code) public static MiniAppUserCache GetWeChatOpenId(string AppId, string AppSecret, string Code, string phoneCode = "",string access_token="")
{ {
MiniAppUserCache miniAppUserCache = new MiniAppUserCache(); MiniAppUserCache miniAppUserCache = new MiniAppUserCache();
string result = ""; string result = "";
...@@ -58,6 +60,33 @@ namespace Mall.Common.Plugin ...@@ -58,6 +60,33 @@ namespace Mall.Common.Plugin
{ {
Common.Plugin.LogHelper.WriteInfo(string.Format("GetWeChatOpenId:AppId_{0} result_{1}", AppId, result)); Common.Plugin.LogHelper.WriteInfo(string.Format("GetWeChatOpenId:AppId_{0} result_{1}", AppId, result));
} }
if (!string.IsNullOrEmpty(phoneCode) && !string.IsNullOrEmpty(access_token))
{
//用 phoneCode 换取手机号
try
{
object phoneMsg = new { code = phoneCode };
string phoneUrl = $"https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token={access_token}";
string phoneResult = Common.Plugin.HttpHelper.HttpPost(phoneUrl, JsonHelper.Serialize(phoneMsg), contenttype: "");
if (!string.IsNullOrEmpty(phoneResult))
{
JObject phoneObj = JObject.Parse(phoneResult);
if (phoneObj.ContainsKey("phone_info"))
{
string phoneInfoStr = phoneObj.GetStringValue("phone_info");
if (!string.IsNullOrEmpty(phoneInfoStr))
{
JObject phoneInfoObj = JObject.Parse(phoneInfoStr);
miniAppUserCache.PhoneNum = phoneInfoObj.GetStringValue("phoneNumber");
}
}
}
}
catch (Exception ex1)
{
Common.Plugin.LogHelper.Write(ex1, string.Format("GetWeChatOpenId_GetPhoneNum:result={0}&&Code={1}", result, Code));
}
}
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -73,6 +102,8 @@ namespace Mall.Common.Plugin ...@@ -73,6 +102,8 @@ namespace Mall.Common.Plugin
/// <summary> /// <summary>
/// 验证OpenId是否有效 /// 验证OpenId是否有效
/// </summary> /// </summary>
......
...@@ -240,5 +240,10 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -240,5 +240,10 @@ namespace Mall.Model.Entity.TradePavilion
/// 推荐时间 /// 推荐时间
/// </summary> /// </summary>
public DateTime RecommendDate { get; set; } public DateTime RecommendDate { get; set; }
/// <summary>
/// 分类层级Id(一级分类id,二级分类Id)
/// </summary>
public string MoreBrandClassId { get; set; }
} }
} }
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.Pub
{
/// <summary>
/// 常用公共属性
/// </summary>
public class PubItem
{
/// <summary>
/// 编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
...@@ -5,8 +5,27 @@ using Mall.Model.Entity.TradePavilion; ...@@ -5,8 +5,27 @@ using Mall.Model.Entity.TradePavilion;
namespace Mall.Model.Extend.TradePavilion namespace Mall.Model.Extend.TradePavilion
{ {
public class RB_BrandClass_Extend: RB_BrandClass public class RB_BrandClass_Extend : RB_BrandClass
{ {
} }
public class BrandClassItem
{
/// <summary>
/// 编号
/// </summary>
public int value { get; set; }
/// <summary>
/// 分类名称
/// </summary>
public string label { get; set; }
/// <summary>
/// 下级分类
/// </summary>
public List<BrandClassItem> children { get; set; }
}
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Mall.Model.Entity.TradePavilion; using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.Pub;
namespace Mall.Model.Extend.TradePavilion namespace Mall.Model.Extend.TradePavilion
{ {
...@@ -90,5 +91,15 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -90,5 +91,15 @@ namespace Mall.Model.Extend.TradePavilion
/// 取几天数据 /// 取几天数据
/// </summary> /// </summary>
public int QTop { get; set; } public int QTop { get; set; }
/// <summary>
/// 分类层级Id
/// </summary>
public List<int> MoreBrandClassIdList { get; set; }
/// <summary>
/// 品牌分类
/// </summary>
public List<PubItem> BrandClassList { get; set; }
} }
} }
...@@ -15,6 +15,7 @@ using Mall.Model.Extend.Product; ...@@ -15,6 +15,7 @@ using Mall.Model.Extend.Product;
using RabbitMQ.Client; using RabbitMQ.Client;
using Mall.Common.Enum.TradePavilion; using Mall.Common.Enum.TradePavilion;
using Mall.Model.Query; using Mall.Model.Query;
using Mall.Model.Extend.User;
namespace Mall.Module.TradePavilion namespace Mall.Module.TradePavilion
{ {
...@@ -673,49 +674,56 @@ namespace Mall.Module.TradePavilion ...@@ -673,49 +674,56 @@ namespace Mall.Module.TradePavilion
public List<RB_Brand_Extend> GetBrandPageList(int pageIndex, int pageSize, out long rowsCount, RB_Brand_Extend query, bool IsSelectUser = false) public List<RB_Brand_Extend> GetBrandPageList(int pageIndex, int pageSize, out long rowsCount, RB_Brand_Extend query, bool IsSelectUser = false)
{ {
var list = brandRepository.GetBrandPageList(pageIndex, pageSize, out rowsCount, query); var list = brandRepository.GetBrandPageList(pageIndex, pageSize, out rowsCount, query);
if (IsSelectUser) List<RB_Member_User_Extend> ulist = new List<RB_Member_User_Extend>();
{ if (list != null && list.Any())//绑定奖章
if (list.Where(x => x.UserId > 0).Any())
{ {
//查询用户列表 //查询用户列表
string userIds = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId)); string userIds = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId));
var ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { MallBaseId = query.MallBaseId, UserIds = userIds }); if (IsSelectUser &&!string.IsNullOrEmpty(userIds))
foreach (var item in list.Where(x => x.UserId > 0))
{ {
var umodel = ulist.Where(x => x.Id == item.UserId).FirstOrDefault(); ulist = member_UserRepository.GetList(new Model.Extend.User.RB_Member_User_Extend() { MallBaseId = query.MallBaseId, UserIds = userIds });
item.UserName = umodel.Name;
item.UserIcon = umodel.Photo;
}
} }
} var brandClassList = GetBrandClassListModule(new RB_BrandClass_Extend() { BrandCategory = BrandCategoryEnum.ConsumerBrand, TenantId = query.TenantId, MallBaseId = query.MallBaseId });
if (list != null && list.Any())//绑定奖章
{
string sourceIds = string.Join(",", list.Where(x => !string.IsNullOrWhiteSpace(x.SourceIds)).Select(x => x.SourceIds)); string sourceIds = string.Join(",", list.Where(x => !string.IsNullOrWhiteSpace(x.SourceIds)).Select(x => x.SourceIds));
List<RB_Prize_Extend> prizeList = new List<RB_Prize_Extend>(); List<RB_Prize_Extend> prizeList = new List<RB_Prize_Extend>();
if (!string.IsNullOrWhiteSpace(sourceIds)) if (!string.IsNullOrWhiteSpace(sourceIds))
{ {
prizeList = prizeRepository.GetList(new RB_Prize_Extend { MallBaseId = query.MallBaseId, TenantId = query.TenantId, QPrizeIds = sourceIds }); prizeList = prizeRepository.GetList(new RB_Prize_Extend { MallBaseId = query.MallBaseId, TenantId = query.TenantId, QPrizeIds = sourceIds });
} }
if (prizeList != null && prizeList.Any()) foreach (var item in list)
{
foreach (var item in list.Where(x => !string.IsNullOrWhiteSpace(x.SourceIds)))
{ {
item.PrizeList = new List<RB_Prize_Extend>(); item.PrizeList = new List<RB_Prize_Extend>();
foreach (var itemSourceId in item.SourceIds.Split(",")) item.BrandClassList = new List<Model.Extend.Pub.PubItem>();
if (item.UserId > 0)
{
var umodel = ulist.Where(x => x.Id == item.UserId).FirstOrDefault();
item.UserName = umodel.Name;
item.UserIcon = umodel.Photo;
}
var tempSourceList = Common.ConvertHelper.StringToList(item.SourceIds);
foreach (var itemSourceId in tempSourceList)
{ {
var nowPrizeModel = prizeList.Where(x => x.Id.ToString() == itemSourceId).FirstOrDefault(); var nowPrizeModel = prizeList.Where(x => x.Id == itemSourceId).FirstOrDefault();
if (nowPrizeModel != null && nowPrizeModel.Id > 0) if (nowPrizeModel != null && nowPrizeModel.Id > 0)
{ {
item.PrizeList.Add(nowPrizeModel); item.PrizeList.Add(nowPrizeModel);
} }
} }
List<string> brandClassNameList = new List<string>();
var brandTypeList = Common.ConvertHelper.StringToList(item.MoreBrandClassId);
foreach (var subItem in brandTypeList)
{
var tempBrandClass = brandClassList?.FirstOrDefault(qitem => qitem.ID == subItem);
if (tempBrandClass != null && tempBrandClass.ID > 0)
{
item.BrandClassList.Add(new Model.Extend.Pub.PubItem()
{
Id = tempBrandClass.ID,
Name = tempBrandClass.ClassName
});
}
} }
} }
} }
return list; return list;
} }
...@@ -846,7 +854,8 @@ namespace Mall.Module.TradePavilion ...@@ -846,7 +854,8 @@ namespace Mall.Module.TradePavilion
{nameof(RB_Brand_Extend.OpenShopWish),model.OpenShopWish }, {nameof(RB_Brand_Extend.OpenShopWish),model.OpenShopWish },
{nameof(RB_Brand_Extend.IsInChengdu),model.IsInChengdu }, {nameof(RB_Brand_Extend.IsInChengdu),model.IsInChengdu },
{nameof(RB_Brand_Extend.ContactName),model.ContactName }, {nameof(RB_Brand_Extend.ContactName),model.ContactName },
{nameof(RB_Brand_Extend.ContactPhone),model.ContactPhone } {nameof(RB_Brand_Extend.ContactPhone),model.ContactPhone },
{nameof(RB_Brand_Extend.MoreBrandClassId),model.MoreBrandClassId }
}; };
return brandRepository.Update(fileds, new WhereHelper(nameof(RB_Brand_Extend.ID), model.ID)); return brandRepository.Update(fileds, new WhereHelper(nameof(RB_Brand_Extend.ID), model.ID));
} }
...@@ -1104,6 +1113,41 @@ namespace Mall.Module.TradePavilion ...@@ -1104,6 +1113,41 @@ namespace Mall.Module.TradePavilion
return brandClassRepository.GetBrandClassListRepository(query); return brandClassRepository.GetBrandClassListRepository(query);
} }
/// <summary>
/// 获取品牌分类树形结构
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<BrandClassItem> GetBrandClassTreeModule(RB_BrandClass_Extend query)
{
List<BrandClassItem> brandClassList = new List<BrandClassItem>();
var list = brandClassRepository.GetBrandClassListRepository(query);
var rootList = list.Where(qitem => qitem.ParentId == 0)?.OrderBy(qitem => qitem.SortNum)?.ToList() ?? new List<RB_BrandClass_Extend>();
foreach (var rootItem in rootList)
{
BrandClassItem rootModel = new BrandClassItem()
{
value = rootItem.ID,
label = rootItem.ClassName,
};
var subList = list.Where(qitem => qitem.ParentId == rootItem.ID)?.OrderBy(qitem => qitem.SortNum)?.ToList() ?? new List<RB_BrandClass_Extend>();
if (subList != null && subList.Count > 0)
{
rootModel.children = new List<BrandClassItem>();
foreach (var subItem in subList)
{
rootModel.children.Add(new BrandClassItem()
{
value = subItem.ID,
label = subItem.ClassName,
});
}
}
brandClassList.Add(rootModel);
}
return brandClassList;
}
/// <summary> /// <summary>
/// 获取商载通链接 /// 获取商载通链接
/// </summary> /// </summary>
......
using System; using Mall.Model.Entity.User;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Mall.Repository; using System.Collections.Generic;
using System.Linq; using System.Linq;
using VT.FW.DB; using VT.FW.DB;
...@@ -62,10 +60,25 @@ namespace Mall.Module.User ...@@ -62,10 +60,25 @@ namespace Mall.Module.User
} }
else else
{ {
var newId = plugInRepository.Insert(model); try
{
var newModel = new RB_PlugIn()
{
Id = model.Id,
Icon = model.Icon,
Name = model.Name,
PlugType = model.PlugType,
Status = 0,
};
var newId = plugInRepository.Insert(newModel);
model.PlugId = newId; model.PlugId = newId;
flag = newId > 0; flag = newId > 0;
} }
catch
{
}
}
return flag; return flag;
} }
......
...@@ -340,7 +340,33 @@ namespace Mall.Module.User ...@@ -340,7 +340,33 @@ namespace Mall.Module.User
}; };
List<WhereHelper> wheres = new List<WhereHelper>() List<WhereHelper> wheres = new List<WhereHelper>()
{ {
new WhereHelper(){ new WhereHelper()
{
FiledName=nameof(RB_Member_User.Id),
FiledValue=Id,
OperatorEnum=OperatorEnum.Equal
}
};
bool flag = member_UserRepository.Update(fileds, wheres);
return flag;
}
/// <summary>
/// 更新用户电话
/// </summary>
/// <param name="Mobile"></param>
/// <param name="Id"></param>
/// <returns></returns>
public bool UpdateMemberUserMobile(string Mobile, int Id)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Member_User_Extend.Moblie),Mobile }
};
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName=nameof(RB_Member_User.Id), FiledName=nameof(RB_Member_User.Id),
FiledValue=Id, FiledValue=Id,
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
...@@ -406,9 +432,6 @@ namespace Mall.Module.User ...@@ -406,9 +432,6 @@ namespace Mall.Module.User
return list; return list;
} }
/// <summary> /// <summary>
///根据昵称ID手机号码 获取列表 ///根据昵称ID手机号码 获取列表
/// </summary> /// </summary>
...@@ -419,11 +442,6 @@ namespace Mall.Module.User ...@@ -419,11 +442,6 @@ namespace Mall.Module.User
return member_UserRepository.GetListByPhoneOrAliasName(dmodel); return member_UserRepository.GetListByPhoneOrAliasName(dmodel);
} }
/// <summary> /// <summary>
/// 分页列表 /// 分页列表
/// </summary> /// </summary>
...@@ -478,7 +496,8 @@ namespace Mall.Module.User ...@@ -478,7 +496,8 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetMemberUserInfoForHT(RB_Member_User_Extend demodel) public bool SetMemberUserInfoForHT(RB_Member_User_Extend demodel)
{ {
Dictionary<string, object> files = new Dictionary<string, object>() { Dictionary<string, object> files = new Dictionary<string, object>()
{
{ nameof(RB_Member_User.MemberGrade),demodel.MemberGrade}, { nameof(RB_Member_User.MemberGrade),demodel.MemberGrade},
{ nameof(RB_Member_User.SuperiorId),demodel.SuperiorId}, { nameof(RB_Member_User.SuperiorId),demodel.SuperiorId},
{ nameof(RB_Member_User.ContactWay),demodel.ContactWay}, { nameof(RB_Member_User.ContactWay),demodel.ContactWay},
...@@ -488,9 +507,12 @@ namespace Mall.Module.User ...@@ -488,9 +507,12 @@ namespace Mall.Module.User
{ nameof(RB_Member_User.PostId),demodel.PostId}, { nameof(RB_Member_User.PostId),demodel.PostId},
{ nameof(RB_Member_User.Blacklist),demodel.Blacklist}, { nameof(RB_Member_User.Blacklist),demodel.Blacklist},
{ nameof(RB_Member_User.IsAdmin),demodel.IsAdmin}, { nameof(RB_Member_User.IsAdmin),demodel.IsAdmin},
{ nameof(RB_Member_User.Moblie),demodel.Moblie},
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>()
new WhereHelper(){ {
new WhereHelper()
{
FiledName=nameof(RB_Member_User.Id), FiledName=nameof(RB_Member_User.Id),
FiledValue=demodel.Id, FiledValue=demodel.Id,
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
...@@ -723,7 +745,8 @@ namespace Mall.Module.User ...@@ -723,7 +745,8 @@ namespace Mall.Module.User
{ nameof(RB_Member_User.Remark),umodel.Remark +" 客人自行升级会员等级:"+gradeModel.Name} { nameof(RB_Member_User.Remark),umodel.Remark +" 客人自行升级会员等级:"+gradeModel.Name}
}; };
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){ new WhereHelper()
{
FiledName=nameof(RB_Member_User.Id), FiledName=nameof(RB_Member_User.Id),
FiledValue=umodel.Id, FiledValue=umodel.Id,
OperatorEnum=OperatorEnum.Equal OperatorEnum=OperatorEnum.Equal
......
using System; using Mall.Model.Entity.User;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using VT.FW.DB.Dapper; using VT.FW.DB.Dapper;
namespace Mall.Repository.User namespace Mall.Repository.User
...@@ -11,7 +10,7 @@ namespace Mall.Repository.User ...@@ -11,7 +10,7 @@ namespace Mall.Repository.User
/// <summary> /// <summary>
/// 插件表仓储层 /// 插件表仓储层
/// </summary> /// </summary>
public class RB_PlugInRepository:BaseRepository<RB_PlugIn> public class RB_PlugInRepository : BaseRepository<RB_PlugIn>
{ {
/// <summary> /// <summary>
/// 根据查询条件获取插件列表 /// 根据查询条件获取插件列表
...@@ -47,7 +46,7 @@ WHERE 1=1 AND A.Status=0 "); ...@@ -47,7 +46,7 @@ WHERE 1=1 AND A.Status=0 ");
/// <param name="rowsCount"></param> /// <param name="rowsCount"></param>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_PlugIn_Extend> GetPlugInPageRepository(int pageIndex,int pageSize,out long rowsCount, RB_PlugIn_Extend query) public List<RB_PlugIn_Extend> GetPlugInPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_PlugIn_Extend query)
{ {
var parameters = new DynamicParameters(); var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
...@@ -76,7 +75,7 @@ WHERE 1=1 AND A.Status=0 "); ...@@ -76,7 +75,7 @@ WHERE 1=1 AND A.Status=0 ");
builder.AppendFormat(@" AND {0} IN({1}) ", nameof(RB_PlugIn_Extend.PlugType), query.QPlugTypeStr); builder.AppendFormat(@" AND {0} IN({1}) ", nameof(RB_PlugIn_Extend.PlugType), query.QPlugTypeStr);
} }
} }
return GetPage<RB_PlugIn_Extend>(pageIndex,pageSize,out rowsCount,builder.ToString(),parameters).ToList(); return GetPage<RB_PlugIn_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
} }
} }
using System; using Dnc.Api.Throttle;
using System.Collections.Generic; using Mall.CacheManager.AppletWeChat;
using System.Linq;
using System.Threading.Tasks;
using Dnc.Api.Throttle;
using Mall.CacheManager.User; using Mall.CacheManager.User;
using Mall.Common; using Mall.Common;
using Mall.Common.API; using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Entity.MarketingCenter; using Mall.Model.Entity.MarketingCenter;
using Mall.Model.Entity.User;
using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.MarketingCenter;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Mall.Module.BaseSetUp;
using Mall.Module.MarketingCenter; using Mall.Module.MarketingCenter;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Module.User; using Mall.Module.User;
...@@ -21,8 +13,10 @@ using Mall.WebApi.Filter; ...@@ -21,8 +13,10 @@ using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
...@@ -724,13 +718,20 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -724,13 +718,20 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
string code = parms.GetStringValue("Code"); string code = parms.GetStringValue("Code");
string phoneCode = parms.GetStringValue("phoneCode");
MiniAppUserCache miniAppUserCache = new MiniAppUserCache(); MiniAppUserCache miniAppUserCache = new MiniAppUserCache();
if (RequestParm.MiniAppId != null && !string.IsNullOrWhiteSpace(RequestParm.MiniAppId)) if (RequestParm.MiniAppId != null && !string.IsNullOrWhiteSpace(RequestParm.MiniAppId))
{ {
var miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = RequestParm.MiniAppId }); var miniProgram = programModule.GetMiniProgramModule(new Model.Extend.User.RB_MiniProgram_Extend() { MiniAppId = RequestParm.MiniAppId });
if (miniProgram != null && miniProgram.MallBaseId > 0) if (miniProgram != null && miniProgram.MallBaseId > 0)
{ {
miniAppUserCache = Common.Plugin.WeiXinHelper.GetWeChatOpenId(miniProgram.MiniAppId, miniProgram.MiniAppSecret, code); string token = WeiXinReidsCache.Get(RequestParm.MiniAppId);
if (string.IsNullOrEmpty(token))
{
token = Mall.Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, RequestParm.MiniAppId, miniProgram.MiniAppSecret);
System.Threading.Tasks.Task.Run(() => WeiXinReidsCache.Set(RequestParm.MiniAppId, token));
}
miniAppUserCache = Common.Plugin.WeiXinHelper.GetWeChatOpenId(miniProgram.MiniAppId, miniProgram.MiniAppSecret, code, phoneCode, token);
} }
} }
var newGuid = "MiniAppOpenId_" + Guid.NewGuid().ToString(); var newGuid = "MiniAppOpenId_" + Guid.NewGuid().ToString();
......
...@@ -1821,6 +1821,16 @@ namespace Mall.WebApi.Controllers ...@@ -1821,6 +1821,16 @@ namespace Mall.WebApi.Controllers
data = activityDataList data = activityDataList
}; };
break; break;
//首店首页数据组件
case "tradeIndex":
var tradeIndexData = subItem.data as educationCustomItem;
obj = new
{
id = subItem.Id,
data = tradeIndexData
};
break;
} }
return obj; return obj;
} }
......
...@@ -1854,6 +1854,26 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1854,6 +1854,26 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.Success(data: list); return ApiResult.Success(data: list);
} }
/// <summary>
/// 获取品牌分类分页列表
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetBrandClassTree()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_BrandClass_Extend
{
MallBaseId = RequestParm.MallBaseId,
TenantId = RequestParm.TenantId,
BrandCategory = (BrandCategoryEnum)parms.GetInt("BrandCategory"),
};
List<object> list = new List<object>();
var dataList = carrierModule.GetBrandClassTreeModule(query);
return ApiResult.Success(data: dataList);
}
/// <summary> /// <summary>
/// 获取品牌分类实体 /// 获取品牌分类实体
/// </summary> /// </summary>
...@@ -1954,6 +1974,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1954,6 +1974,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query.MallBaseId = RequestParm.MallBaseId; query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId; query.TenantId = RequestParm.TenantId;
List<object> list = new List<object>(); List<object> list = new List<object>();
var dataList = carrierModule.GetBrandPageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query, true); var dataList = carrierModule.GetBrandPageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query, true);
foreach (var item in dataList) foreach (var item in dataList)
{ {
...@@ -1984,7 +2005,8 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -1984,7 +2005,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
item.ContactPhone, item.ContactPhone,
item.UserName, item.UserName,
item.IsRecommend, item.IsRecommend,
RecommendDate = Common.ConvertHelper.FormatTime(item.RecommendDate) RecommendDate = Common.ConvertHelper.FormatTime(item.RecommendDate),
item.BrandClassList,
}); });
} }
pageModel.count = Convert.ToInt32(rowsCount); pageModel.count = Convert.ToInt32(rowsCount);
...@@ -2015,7 +2037,7 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2015,7 +2037,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
query.PaiYan = -1; query.PaiYan = -1;
query.Sewage = -1; query.Sewage = -1;
var extModel = carrierModule.GetBrand(query); var extModel = carrierModule.GetBrand(query);
extModel.MoreBrandClassIdList = Common.ConvertHelper.StringToList(extModel.MoreBrandClassId);
if (!string.IsNullOrWhiteSpace(extModel.Banner)) if (!string.IsNullOrWhiteSpace(extModel.Banner))
{ {
extModel.BannerList = JsonConvert.DeserializeObject<List<string>>(extModel.Banner); extModel.BannerList = JsonConvert.DeserializeObject<List<string>>(extModel.Banner);
...@@ -2061,6 +2083,14 @@ namespace Mall.WebApi.Controllers.TradePavilion ...@@ -2061,6 +2083,14 @@ namespace Mall.WebApi.Controllers.TradePavilion
{ {
query.Banner = ""; query.Banner = "";
} }
if (query.MoreBrandClassIdList != null && query.MoreBrandClassIdList.Count > 0)
{
query.MoreBrandClassId = string.Join(",", query.MoreBrandClassIdList);
}
else
{
query.MoreBrandClassId = "";
}
if (query.ID == 0) if (query.ID == 0)
{ {
query.CreateDate = System.DateTime.Now; query.CreateDate = System.DateTime.Now;
......
...@@ -144,6 +144,10 @@ namespace Mall.WebApi.Controllers.User ...@@ -144,6 +144,10 @@ namespace Mall.WebApi.Controllers.User
UserReidsCache.DeleteMiniAppUsetOpenId(demodel.OpenId); UserReidsCache.DeleteMiniAppUsetOpenId(demodel.OpenId);
demodel.OpenId = opcache.UserOpenId; demodel.OpenId = opcache.UserOpenId;
demodel.Unoinid = opcache.UserUnoinid; demodel.Unoinid = opcache.UserUnoinid;
if (!string.IsNullOrEmpty(opcache.PhoneNum) && string.IsNullOrEmpty(demodel.Moblie))
{
demodel.Moblie = opcache.PhoneNum;
}
} }
else else
{ {
...@@ -268,6 +272,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -268,6 +272,7 @@ namespace Mall.WebApi.Controllers.User
isGiveCoupon = true; isGiveCoupon = true;
} }
} }
#region 粉象返佣 自动注册分销商 普通会员等级 #region 粉象返佣 自动注册分销商 普通会员等级
if ((basicsModel?.IsEnableFXGrade ?? 2) == 1) if ((basicsModel?.IsEnableFXGrade ?? 2) == 1)
{ {
...@@ -282,8 +287,10 @@ namespace Mall.WebApi.Controllers.User ...@@ -282,8 +287,10 @@ namespace Mall.WebApi.Controllers.User
} }
} }
#endregion #endregion
//返回基本信息 //返回基本信息
TokenUserInfo userInfo = new TokenUserInfo { uid = UserId.ToString(), requestFrom = ApiRequestFromEnum.MiniProgram }; TokenUserInfo userInfo = new TokenUserInfo { uid = UserId.ToString(), requestFrom = ApiRequestFromEnum.MiniProgram };
#region 生成Token #region 生成Token
string token = ApiTokenHelper.CreateToken(userInfo); string token = ApiTokenHelper.CreateToken(userInfo);
#endregion #endregion
...@@ -378,6 +385,12 @@ namespace Mall.WebApi.Controllers.User ...@@ -378,6 +385,12 @@ namespace Mall.WebApi.Controllers.User
{ {
userModule.UpdateMemberUserUnionId(demodel.Unoinid, umodel.Id); userModule.UpdateMemberUserUnionId(demodel.Unoinid, umodel.Id);
} }
//更新用户手机号码
if (demodel.Moblie != umodel.Moblie && !string.IsNullOrEmpty(demodel.Moblie))
{
userModule.UpdateMemberUserMobile(demodel.Moblie, umodel.Id);
}
//自动发放新人优惠券 2020-12-31 Add By:W //自动发放新人优惠券 2020-12-31 Add By:W
if (demodel.CounponPassword == 5 && !string.IsNullOrWhiteSpace(demodel.KeyWord)) if (demodel.CounponPassword == 5 && !string.IsNullOrWhiteSpace(demodel.KeyWord))
{ {
......
...@@ -105,7 +105,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -105,7 +105,7 @@ namespace Mall.WebApi.Controllers.User
x.PostId, x.PostId,
PostName = (x?.PostId ?? 0) == 1 ? "领队导游" : "", PostName = (x?.PostId ?? 0) == 1 ? "领队导游" : "",
UserPageTypeStr = x.UserPageType.GetEnumName(), UserPageTypeStr = x.UserPageType.GetEnumName(),
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "" CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
}); ; }); ;
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
......
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