mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:03:27 +08:00
【优化】优化微信小程序及微信公众号同时登录同一账号下,同时支付异常的问题。
【优化】优化后台微信用户列表展示,增加区分微信小程序和微信公众号来源的划分。
This commit is contained in:
@@ -29,6 +29,7 @@ using Newtonsoft.Json.Linq;
|
||||
using QRCoder;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api;
|
||||
using SKIT.FlurlHttpClient.Wechat.Api.Models;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
@@ -80,7 +81,7 @@ namespace CoreCms.Net.Services
|
||||
|
||||
var payment = await billPaymentsServices.QueryByClauseAsync(p => p.paymentId == entity.paymentId);
|
||||
var checkBeforeAddOrder = await checkBeforeAddOrderServices.QueryByClauseAsync(p => p.orderId == payment.sourceId);
|
||||
if (checkBeforeAddOrder != null && checkBeforeAddOrder.requireOrder == (int)GlobalEnumVars.RequireOrderType.需要)
|
||||
if (checkBeforeAddOrder is { requireOrder: (int)GlobalEnumVars.RequireOrderType.需要 })
|
||||
{
|
||||
var order = await transactionComponentOrderServices.QueryByClauseAsync(p => p.outOrderId == payment.sourceId);
|
||||
|
||||
@@ -158,26 +159,38 @@ namespace CoreCms.Net.Services
|
||||
var openId = string.Empty;
|
||||
if (tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString() || tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI_OFFICIAL.ToString())
|
||||
{
|
||||
var userAccount = await _userServices.QueryByIdAsync(_user.ID);
|
||||
if (userAccount == null)
|
||||
{
|
||||
jm.msg = "用户账户获取失败";
|
||||
return jm;
|
||||
}
|
||||
//var userAccount = await _userServices.QueryByIdAsync(_user.ID);
|
||||
//if (userAccount == null)
|
||||
//{
|
||||
// jm.msg = "用户账户获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
if (userAccount.userWx <= 0)
|
||||
{
|
||||
jm.msg = "账户关联微信用户信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
//if (userAccount.userWx <= 0)
|
||||
//{
|
||||
// jm.msg = "账户关联微信用户信息获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.id == userAccount.userWx);
|
||||
//var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.id == userAccount.userWx);
|
||||
//if (user == null)
|
||||
//{
|
||||
// jm.msg = "微信用户信息获取失败";
|
||||
// return jm;
|
||||
//}
|
||||
|
||||
var type = tradeType == GlobalEnumVars.WeiChatPayTradeType.JSAPI.ToString()
|
||||
? (int)GlobalEnumVars.UserAccountTypes.微信小程序
|
||||
: (int)GlobalEnumVars.UserAccountTypes.微信公众号;
|
||||
|
||||
var user = await _userWeChatInfoServices.QueryByClauseAsync(p => p.userId == _user.ID && p.type == type, p => p.createTime, OrderByType.Desc);
|
||||
if (user == null)
|
||||
{
|
||||
jm.msg = "微信用户信息获取失败";
|
||||
return jm;
|
||||
}
|
||||
|
||||
|
||||
openId = user.openid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user