修复日志
This commit is contained in:
parent
4e06d652aa
commit
17ea052abe
|
|
@ -94,7 +94,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
var userCurrency = dao.daoDbMiaoYu.context.T_User_Currency.Where(it => it.UserId == user.Id).ToList();
|
||||
return userCurrency;
|
||||
}
|
||||
|
||||
|
||||
#region 不带事务
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -201,7 +201,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
userCurrencyConsumeType = UserCurrencyConsumeType.充值;
|
||||
}
|
||||
|
||||
if (userCurrencyType == UserCurrencyType.聊天次数)
|
||||
if (userCurrencyType == UserCurrencyType.聊天次数 && userCurrencyConsumeType == UserCurrencyConsumeType.消耗)
|
||||
{
|
||||
var mintes = DateTime.Now.AddMinutes(-5);
|
||||
log = dao.daoDbMiaoYu.context.T_User_Currency_Log.Where(it => it.CreateTime > mintes).OrderByDescending(it => it.CreateTime).FirstOrDefault();
|
||||
|
|
@ -212,7 +212,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
{
|
||||
log = new T_User_Currency_Log()
|
||||
{
|
||||
Consume = tempMoney,
|
||||
Consume = 0,
|
||||
ConsumeType = (int)userCurrencyConsumeType,
|
||||
CreateTime = DateTime.Now,
|
||||
CurrencyType = (int)userCurrencyType,
|
||||
|
|
@ -223,6 +223,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
};
|
||||
dao.daoDbMiaoYu.context.T_User_Currency_Log.Add(log);
|
||||
}
|
||||
log.Consume += money;
|
||||
log.Remarks += $"于{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}{userCurrencyConsumeType.ToString()}[{tempMoney}]{userCurrencyType.ToString()};";
|
||||
if (log.Remarks.Length > 200)
|
||||
{
|
||||
|
|
@ -356,7 +357,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
userCurrencyConsumeType = UserCurrencyConsumeType.充值;
|
||||
}
|
||||
|
||||
if (userCurrencyType == UserCurrencyType.聊天次数)
|
||||
if (userCurrencyType == UserCurrencyType.聊天次数 && userCurrencyConsumeType == UserCurrencyConsumeType.消耗)
|
||||
{
|
||||
var mintes = DateTime.Now.AddMinutes(-5);
|
||||
log = dao.daoDbMiaoYu.context.T_User_Currency_Log.Where(it => it.CreateTime > mintes).OrderByDescending(it => it.CreateTime).FirstOrDefault();
|
||||
|
|
@ -367,7 +368,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
{
|
||||
log = new T_User_Currency_Log()
|
||||
{
|
||||
Consume = tempMoney,
|
||||
Consume = 0,
|
||||
ConsumeType = (int)userCurrencyConsumeType,
|
||||
CreateTime = DateTime.Now,
|
||||
CurrencyType = (int)userCurrencyType,
|
||||
|
|
@ -378,7 +379,7 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
};
|
||||
dao.daoDbMiaoYu.context.T_User_Currency_Log.Add(log);
|
||||
}
|
||||
|
||||
log.Consume += money;
|
||||
log.Remarks += $"于{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}{userCurrencyConsumeType.ToString()}[{tempMoney}]{userCurrencyType.ToString()};";
|
||||
if (log.Remarks.Length > 200)
|
||||
{
|
||||
|
|
@ -398,6 +399,6 @@ namespace HuanMeng.MiaoYu.Code.Users
|
|||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using HuanMeng.MiaoYu.Code.Other;
|
|||
using HuanMeng.MiaoYu.Code.Users;
|
||||
using HuanMeng.MiaoYu.Model.Dto;
|
||||
using HuanMeng.MiaoYu.Model.Dto.Account;
|
||||
using HuanMeng.MiaoYu.Model.Dto.Shop;
|
||||
using HuanMeng.MiaoYu.WebApi.Base;
|
||||
using HuanMeng.Utility;
|
||||
|
||||
|
|
@ -76,7 +77,6 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
|
|||
/// 我的账户
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<MyAccountInfoDto>> GetMyAccount()
|
||||
{
|
||||
|
|
@ -88,7 +88,6 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
|
|||
/// 我的 - 获取交易记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<List<TransactionDto>>> GetTransactionRecords()
|
||||
{
|
||||
|
|
@ -100,12 +99,12 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
|
|||
/// 商城 - 获取商城商品
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//[AllowAnonymous]
|
||||
//[HttpGet]
|
||||
//public async Task<BaseResponse<ShopInfoDto>> GetMallItem()
|
||||
//{
|
||||
// var obj = JsonConvert.DeserializeObject<ShopInfoDto>("{\"Mall\":[{\"PropId\":1,\"PropName\":\"记忆卡1\",\"PropCount\":100,\"PropType\":0,\"Price\":10,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110512.png\"},{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\"}],\"Purchased\":[{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\",\"BuyingTime\":\"2024-07-09 03:33:09.563\"}]}");
|
||||
// return new BaseResponse<ShopInfoDto>(ResonseCode.Success, "", obj);
|
||||
//}
|
||||
[AllowAnonymous]
|
||||
[HttpGet]
|
||||
public async Task<BaseResponse<ShopInfoDto>> GetMallItem()
|
||||
{
|
||||
var obj = JsonConvert.DeserializeObject<ShopInfoDto>("{\"Mall\":[{\"PropId\":1,\"PropName\":\"记忆卡1\",\"PropCount\":100,\"PropType\":0,\"Price\":10,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110512.png\"},{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\"}],\"Purchased\":[{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\",\"BuyingTime\":\"2024-07-09 03:33:09.563\"}]}");
|
||||
return new BaseResponse<ShopInfoDto>(ResonseCode.Success, "", obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user