Commit 88cf656f authored by 黄奎's avatar 黄奎

新增字段

parent b569d762
...@@ -678,5 +678,10 @@ namespace Mall.Model.Entity.Product ...@@ -678,5 +678,10 @@ namespace Mall.Model.Entity.Product
/// 进阶小课堂老师Id /// 进阶小课堂老师Id
/// </summary> /// </summary>
public int EduTeacherId { get; set; } public int EduTeacherId { get; set; }
/// <summary>
///进阶小课堂 是否显示商品(1-显示,0-不显示)
/// </summary>
public int IsShow { get; set; }
} }
} }
...@@ -1449,18 +1449,17 @@ namespace Mall.Module.Product ...@@ -1449,18 +1449,17 @@ namespace Mall.Module.Product
var appletWeChatModel = programRepository.GetEntity(mallBaseId); var appletWeChatModel = programRepository.GetEntity(mallBaseId);
string token = CacheManager.AppletWeChat.WeiXinReidsCache.Get(appletWeChatModel.MiniAppId); string token = CacheManager.AppletWeChat.WeiXinReidsCache.Get(appletWeChatModel.MiniAppId);
int IsNormalServer = Convert.ToInt32(Config.IsNormalServer); int IsNormalServer = Convert.ToInt32(Config.IsNormalServer);
if (IsNormalServer != 1) //if (IsNormalServer != 1)
{ //{
token = "38_LJMrD0ffPj7GXvXxgGMwDMx9Qs_tXYe0HObmYw_2IGQUTRWSk9WbmrROPvEHEGgroSkhOctTFXFO1RAcYKo0uxrTHw5aRz9NXZ_t3Tp4M486c5XkLvPamTfWg_LaegNpvAqfVGWR-IiBbVL9GURgACAUIF"; // token = "38_LJMrD0ffPj7GXvXxgGMwDMx9Qs_tXYe0HObmYw_2IGQUTRWSk9WbmrROPvEHEGgroSkhOctTFXFO1RAcYKo0uxrTHw5aRz9NXZ_t3Tp4M486c5XkLvPamTfWg_LaegNpvAqfVGWR-IiBbVL9GURgACAUIF";
} //}
if (string.IsNullOrEmpty(token)) if (string.IsNullOrEmpty(token))
{ {
token = Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, appletWeChatModel.MiniAppId, appletWeChatModel.MiniAppSecret); token = Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, appletWeChatModel.MiniAppId, appletWeChatModel.MiniAppSecret);
System.Threading.Tasks.Task.Run(() => CacheManager.AppletWeChat.WeiXinReidsCache.Set(appletWeChatModel.MiniAppId, token)); System.Threading.Tasks.Task.Run(() => CacheManager.AppletWeChat.WeiXinReidsCache.Set(appletWeChatModel.MiniAppId, token));
} }
if (!string.IsNullOrEmpty(token)) if (!string.IsNullOrEmpty(token))
{ {
//string GetImageUrl = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + token;//获取二维码
string GetImageUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + token;//获取小程序码 string GetImageUrl = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + token;//获取小程序码
var postData = new var postData = new
{ {
...@@ -1471,7 +1470,6 @@ namespace Mall.Module.Product ...@@ -1471,7 +1470,6 @@ namespace Mall.Module.Product
string basepath = AppContext.BaseDirectory; string basepath = AppContext.BaseDirectory;
string path_server = basepath + "\\upfile\\temporary\\" + pathName; string path_server = basepath + "\\upfile\\temporary\\" + pathName;
var Robj = HttpHelper.HttpPostForGetWXQRCodePath(GetImageUrl, JsonHelper.Serialize(postData), path_server); var Robj = HttpHelper.HttpPostForGetWXQRCodePath(GetImageUrl, JsonHelper.Serialize(postData), path_server);
//var Robj1 = HttpHelper.HttpPost(GetImageUrl, JsonHelper.Serialize(postData), "");
return "/upfile/temporary/" + pathName; return "/upfile/temporary/" + pathName;
} }
return ""; return "";
......
...@@ -140,6 +140,10 @@ namespace Mall.Repository.Product ...@@ -140,6 +140,10 @@ namespace Mall.Repository.Product
{ {
where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} =0"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsEduType)} =0";
} }
if (dmodel.TenantId == 27 || dmodel.MallBaseId == 17)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsShow)} in(1)";
}
string orderBy = " g.CreateDate desc"; string orderBy = " g.CreateDate desc";
if (dmodel.OrderBy == 1) if (dmodel.OrderBy == 1)
{ {
...@@ -659,6 +663,10 @@ where {where} group by g.Id order by {orderBy}"; ...@@ -659,6 +663,10 @@ where {where} group by g.Id order by {orderBy}";
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)"; where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)";
} }
} }
if (dmodel.TenantId == 27 || dmodel.MallBaseId == 17)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsShow)} in(1)";
}
string sql = $@" string sql = $@"
SELECT g.*,C.CategoryId SELECT g.*,C.CategoryId
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
...@@ -983,6 +991,10 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -983,6 +991,10 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{ {
where += $@" and g.{nameof(RB_Goods_Extend.EduTeacherId)} ={dmodel.EduTeacherId}"; where += $@" and g.{nameof(RB_Goods_Extend.EduTeacherId)} ={dmodel.EduTeacherId}";
} }
if (dmodel.TenantId == 27 || dmodel.MallBaseId == 17)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsShow)} in(1)";
}
//默认综合【升序】 //默认综合【升序】
string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc"; string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc";
//上架时间【降序】 //上架时间【降序】
......
...@@ -73,7 +73,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -73,7 +73,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetHome() public ApiResult GetHome()
{ {
...@@ -488,7 +488,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -488,7 +488,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetAppConfig() public ApiResult GetAppConfig()
{ {
...@@ -521,7 +521,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -521,7 +521,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetUserCenter() public ApiResult GetUserCenter()
{ {
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
...@@ -688,7 +689,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -688,7 +689,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetUserInfo() public ApiResult GetUserInfo()
{ {
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId)) if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
...@@ -708,7 +710,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -708,7 +710,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetWeChatOpenId() public ApiResult GetWeChatOpenId()
{ {
...@@ -723,7 +725,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -723,7 +725,7 @@ namespace Mall.WebApi.Controllers.MallBase
miniAppUserCache = Common.Plugin.WeiXinHelper.GetWeChatOpenId(miniProgram.MiniAppId, miniProgram.MiniAppSecret, code); miniAppUserCache = Common.Plugin.WeiXinHelper.GetWeChatOpenId(miniProgram.MiniAppId, miniProgram.MiniAppSecret, code);
} }
} }
var newGuid ="MiniAppOpenId_"+Guid.NewGuid().ToString(); var newGuid = "MiniAppOpenId_" + Guid.NewGuid().ToString();
UserReidsCache.SetMiniAppUsetOpenId(newGuid, miniAppUserCache); UserReidsCache.SetMiniAppUsetOpenId(newGuid, miniAppUserCache);
return ApiResult.Success(data: newGuid); return ApiResult.Success(data: newGuid);
} }
...@@ -734,7 +736,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -734,7 +736,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetMessageTemplate() public ApiResult GetMessageTemplate()
{ {
...@@ -751,14 +753,14 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -751,14 +753,14 @@ namespace Mall.WebApi.Controllers.MallBase
} }
/// <summary> /// <summary>
/// 获取用户信息 /// 获取用户信息
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetGoosPoster() public ApiResult GetGoosPoster()
{ {
string MiniAppId = ""; string MiniAppId = "";
......
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