Commit b19220d5 authored by 黄奎's avatar 黄奎
parents b92eb5e3 b484f72d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" /> <ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" /> <ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" /> <ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
......
...@@ -1112,8 +1112,8 @@ namespace Mall.Module.Product ...@@ -1112,8 +1112,8 @@ namespace Mall.Module.Product
if (cList.Any()) if (cList.Any())
{ {
string cIds = string.Join(",", cList.Select(x => x.CouponId).Distinct()); string cIds = string.Join(",", cList.Select(x => x.CouponId).Distinct());
dcList = discountCouponRepository.GetDiscountCouponList(new Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend() { CouponIds = cIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); dcList = discountCouponRepository.GetDiscountCouponList(new Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend() { CouponIds = cIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, true);
dcpList = discountCoupon_ProductRepository.GetListByDiscountCouponIds(new Model.Entity.MarketingCenter.RB_DiscountCoupon() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds); dcpList = discountCoupon_ProductRepository.GetListByDiscountCouponIds(new Model.Entity.MarketingCenter.RB_DiscountCoupon() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds, true);
if (dcList.Any()) if (dcList.Any())
{ {
foreach (var item in cList) foreach (var item in cList)
...@@ -2032,8 +2032,8 @@ namespace Mall.Module.Product ...@@ -2032,8 +2032,8 @@ namespace Mall.Module.Product
if (cList.Any()) if (cList.Any())
{ {
string cIds = string.Join(",", cList.Select(x => x.CouponId).Distinct()); string cIds = string.Join(",", cList.Select(x => x.CouponId).Distinct());
dcList = discountCouponRepository.GetDiscountCouponList(new Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend() { CouponIds = cIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); dcList = discountCouponRepository.GetDiscountCouponList(new Model.Extend.MarketingCenter.RB_DiscountCoupon_Extend() { CouponIds = cIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, true);
dcpList = discountCoupon_ProductRepository.GetListByDiscountCouponIds(new Model.Entity.MarketingCenter.RB_DiscountCoupon() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds); dcpList = discountCoupon_ProductRepository.GetListByDiscountCouponIds(new Model.Entity.MarketingCenter.RB_DiscountCoupon() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }, cIds, true);
if (dcList.Any()) if (dcList.Any())
{ {
foreach (var item in cList) foreach (var item in cList)
......
...@@ -3,8 +3,6 @@ using System.Collections.Generic; ...@@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Mall.Common;
using Mall.Common.API;
using Mall.Common.Plugin; using Mall.Common.Plugin;
using Mall.Model.Entity.Product; using Mall.Model.Entity.Product;
using Mall.Model.Entity.User; using Mall.Model.Entity.User;
...@@ -220,7 +218,7 @@ namespace Mall.Module.Product ...@@ -220,7 +218,7 @@ namespace Mall.Module.Product
//会员价格 //会员价格
var MemberPriceList = new List<RB_Goods_MemberPrice_Extend>(); var MemberPriceList = new List<RB_Goods_MemberPrice_Extend>();
if (list.Where(x=> x.EnjoyMember == 1 && x.SeparateSetMember == 1).Any()) if (list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Any())
{ {
string goodsIds = string.Join(",", list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Select(x => x.Id)); string goodsIds = string.Join(",", list.Where(x => x.EnjoyMember == 1 && x.SeparateSetMember == 1).Select(x => x.Id));
MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsIds = goodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
...@@ -869,6 +867,100 @@ namespace Mall.Module.Product ...@@ -869,6 +867,100 @@ namespace Mall.Module.Product
return model; return model;
} }
/// <summary>
/// 获取商品分享
/// </summary>
/// <returns></returns>
public object GetAppletGoodsShareInfo(int goodsId, int userId, string path, int mallBaseId)
{
string QRPath = GetWeiXinQRCode(path, 430, mallBaseId);
var umodel = member_UserRepository.GetEntity(userId);
var goodsModel = goodsRepository.GetEntity(goodsId);
if (goodsModel == null)
{
return new
{
goods_name = "",
multi_map = new List<string>(),
is_negotiable = 0,
min_price = 0,
max_price = 0,
nickname = umodel?.Name ?? "",
avatar = umodel?.Photo ?? "",
qrcode_url = QRPath,
sign = ""
};
}
else {
//商品图片处理
var imgList = new List<string>();
if (!string.IsNullOrEmpty(goodsModel.CarouselImage) && goodsModel.CarouselImage != "[]") {
imgList = JsonConvert.DeserializeObject<List<string>>(goodsModel.CarouselImage);
}
if (imgList.Any()) {
if (imgList.Count() < 8) {
var imgList2 = new List<string>();
int Num = 8 / imgList.Count();
for (var i = 0; i < Num + 1; i++) {
imgList2.AddRange(imgList);
}
imgList = imgList2.Take(8).ToList();
}
}
return new
{
goods_name = goodsModel.Name,
multi_map = imgList,
is_negotiable = 0,
min_price = goodsModel.SellingPrice,
max_price = goodsModel.SellingPrice,
nickname = umodel?.Name ?? "",
avatar = umodel?.Photo ?? "",
qrcode_url = QRPath,
sign = ""
};
}
}
#region 获取小程序码
/// <summary>
/// 生成小程序码
/// </summary>
/// <param name="path"></param>
/// <param name="width"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public string GetWeiXinQRCode(string path, int width, int mallBaseId)
{
var appletWeChatModel = programRepository.GetEntity(mallBaseId);
string token = CacheManager.AppletWeChat.WeiXinReidsCache.Get(appletWeChatModel.MiniAppId);
if (string.IsNullOrEmpty(token))
{
token = Common.Pay.WeChatPat.TokenHelper.GetLXYToken(token, appletWeChatModel.MiniAppId, appletWeChatModel.MiniAppSecret);
System.Threading.Tasks.Task.Run(() => CacheManager.AppletWeChat.WeiXinReidsCache.Set(appletWeChatModel.MiniAppId, 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;//获取小程序码
var postData = new
{
path,
width
};
string pathName = Guid.NewGuid().ToString() + ".jpg";
string basepath = AppContext.BaseDirectory;
string path_server = basepath + "\\upfile\\temporary\\" + pathName;
var Robj = HttpHelper.HttpPostForGetWXQRCodePath(GetImageUrl, JsonHelper.Serialize(postData), path_server);
//var Robj1 = HttpHelper.HttpPost(GetImageUrl, JsonHelper.Serialize(postData), "");
return Robj;
}
return "";
}
#endregion
/// <summary> /// <summary>
/// 获取小程序商品详情 /// 获取小程序商品详情
/// </summary> /// </summary>
...@@ -1610,7 +1702,7 @@ namespace Mall.Module.Product ...@@ -1610,7 +1702,7 @@ namespace Mall.Module.Product
{ {
integral = new integral = new
{ {
title = "购买可得" + Integral + "积分" title = Integral > 0 ? "购买可得" + Integral + "积分" : ""
} }
}, },
//plugin_extra = new List<object>(), //plugin_extra = new List<object>(),
......
...@@ -2972,6 +2972,7 @@ namespace Mall.Module.User ...@@ -2972,6 +2972,7 @@ namespace Mall.Module.User
{ {
return ""; return "";
} }
var baseModel = distributor_BasicsRepository.GetList(new RB_Distributor_Basics_Extend() { TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId }).FirstOrDefault();
return new return new
{ {
...@@ -2979,7 +2980,8 @@ namespace Mall.Module.User ...@@ -2979,7 +2980,8 @@ namespace Mall.Module.User
{ {
CustomModel.CommissionTobePaidName, CustomModel.CommissionTobePaidName,
CustomModel.UserNotesName, CustomModel.UserNotesName,
CustomModel.IWantToWithdrawName CustomModel.IWantToWithdrawName,
baseModel.UserNotes
}, },
CommissionInfo = new CommissionInfo = new
{ {
......
...@@ -57,10 +57,17 @@ namespace Mall.Repository.MarketingCenter ...@@ -57,10 +57,17 @@ namespace Mall.Repository.MarketingCenter
/// </summary> /// </summary>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_DiscountCoupon_Extend> GetDiscountCouponList(RB_DiscountCoupon_Extend query) public List<RB_DiscountCoupon_Extend> GetDiscountCouponList(RB_DiscountCoupon_Extend query,bool IsSelectDel = false)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
if (IsSelectDel)
{
builder.Append($" SELECT * FROM {TableName} WHERE 1=1 ");
}
else
{
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_DiscountCoupon_Extend.Status)}=0 "); builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_DiscountCoupon_Extend.Status)}=0 ");
}
if (query != null) if (query != null)
{ {
if (query.ID > 0) if (query.ID > 0)
......
...@@ -60,7 +60,7 @@ namespace Mall.Repository.MarketingCenter ...@@ -60,7 +60,7 @@ namespace Mall.Repository.MarketingCenter
/// </summary> /// </summary>
/// <param name="query">查询条件</param> /// <param name="query">查询条件</param>
/// <returns></returns> /// <returns></returns>
public List<RB_DiscountCoupon_Product_Extend> GetListByDiscountCouponIds(RB_DiscountCoupon query, string DiscountCouponIds) public List<RB_DiscountCoupon_Product_Extend> GetListByDiscountCouponIds(RB_DiscountCoupon query, string DiscountCouponIds,bool IsSelectDel =false)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
...@@ -80,7 +80,14 @@ namespace Mall.Repository.MarketingCenter ...@@ -80,7 +80,14 @@ namespace Mall.Repository.MarketingCenter
{ {
builder.Append($" AND a.{nameof(RB_DiscountCoupon_Product.DiscountCouponId)} in ({DiscountCouponIds})"); builder.Append($" AND a.{nameof(RB_DiscountCoupon_Product.DiscountCouponId)} in ({DiscountCouponIds})");
} }
string sql = $"SELECT a.* from {TableName} as a WHERE a.{nameof(RB_DiscountCoupon_Product.Status)}=0 {builder.ToString()} "; string sql = "";
if (IsSelectDel)
{
sql = $"SELECT a.* from {TableName} as a WHERE 1=1 ";
}
else {
sql = $"SELECT a.* from {TableName} as a WHERE a.{nameof(RB_DiscountCoupon_Product.Status)}=0 {builder.ToString()} ";
}
if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Category) if (query.UseType == Common.Enum.MarketingCenter.UseTypeEnum.Category)
{ {
sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {PCategoryTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_DiscountCoupon_Product.Status)}=0 {builder.ToString()} "; sql = $" SELECT a.*,b.`Name` as Relevance from {TableName} as a LEFT JOIN {PCategoryTableName} as b on a.ProductId=b.Id WHERE a.{nameof(RB_DiscountCoupon_Product.Status)}=0 {builder.ToString()} ";
......
...@@ -66,6 +66,8 @@ namespace Mall.WebApi.App_Code ...@@ -66,6 +66,8 @@ namespace Mall.WebApi.App_Code
req.SetParameter("sign", req.CreateMd5Sign(_accessor, model.WeChatApiSecret)); req.SetParameter("sign", req.CreateMd5Sign(_accessor, model.WeChatApiSecret));
var reqXml = req.ParseXml(); var reqXml = req.ParseXml();
LogHelper.Write(null, "订单号【" + sOrderNo + "】请求参数:" + reqXml);
var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam() var result = Common.Pay.WeChatPat.HttpHelper.Post(new HttpParam()
{ {
Url = Mall.Common.Pay.WeChatPat.Model.ApiList.UnifiedOrderUrl, Url = Mall.Common.Pay.WeChatPat.Model.ApiList.UnifiedOrderUrl,
......
...@@ -117,13 +117,15 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -117,13 +117,15 @@ namespace Mall.WebApi.Controllers.MallBase
var auth_page = new object(); var auth_page = new object();
//用户信息 //用户信息
var user_info = new object(); var user_info = new object();
//小程序
var mall = new object();
if (page_id > 0) if (page_id > 0)
{ {
var targetPage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend() var targetPage = miniprogramPageTemplModule.GetMiniprogramPageTemplModule(new RB_Miniprogram_Page_Templ_Extend()
{ {
MallBaseId = miniProgram.MallBaseId, MallBaseId = miniProgram.MallBaseId,
TenantId = miniProgram.TenantId, TenantId = miniProgram.TenantId,
Id=page_id Id = page_id
}, isGetHome: false); }, isGetHome: false);
List<object> list = new List<object>(); List<object> list = new List<object>();
//自定义首页 //自定义首页
...@@ -179,6 +181,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -179,6 +181,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
if (miniProgram != null && miniProgram.MallBaseId > 0) if (miniProgram != null && miniProgram.MallBaseId > 0)
{ {
//底部导航 //底部导航
navbar = new navbar = new
{ {
...@@ -356,6 +359,23 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -356,6 +359,23 @@ namespace Mall.WebApi.Controllers.MallBase
cat_goods_cols = productCategoryStyle?.RowNum cat_goods_cols = productCategoryStyle?.RowNum
}; };
#endregion #endregion
mall = new
{
id = miniProgram.MallBaseId,
name = miniProgram.MallName,
user_id = 0,
created_at = miniProgram.CreateDate.HasValue ? miniProgram.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
updated_at = miniProgram.CreateDate.HasValue ? miniProgram.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
deleted_at = "0000-00-00 00:00:00",
is_delete = miniProgram.Status,
is_recycle = 0,
is_disable = miniProgram.Status,
expired_at = "0000-00-00 00:00:00",
option = new List<object>(),
setting,
};
} }
if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId)) if (RequestParm.OpenId != null && !string.IsNullOrWhiteSpace(RequestParm.OpenId))
...@@ -368,10 +388,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -368,10 +388,10 @@ namespace Mall.WebApi.Controllers.MallBase
var miniPageList = programPageModule.GetMiniprogram_Page_ListExtModule(new RB_MiniProgram_Page_Extend() { MallBaseId = RequestParm.MallBaseId }); var miniPageList = programPageModule.GetMiniprogram_Page_ListExtModule(new RB_MiniProgram_Page_Extend() { MallBaseId = RequestParm.MallBaseId });
var objResult = new var objResult = new
{ {
mall,
home_pages = homePage, home_pages = homePage,
navbar, navbar,
user_info, user_info,
setting,
share_setting, share_setting,
share_setting_custom, share_setting_custom,
cat_style, cat_style,
......
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