修改问题

This commit is contained in:
zpc 2024-11-29 19:50:44 +08:00
parent a2d4a58b6b
commit 8f835754e3
7 changed files with 17 additions and 5 deletions

View File

@ -391,7 +391,8 @@ namespace CloudGaming.Code.Account
{
userInfoDto.IdCard = userInfoDto.IdCard.Substring(0, 4) + "*********" + userInfoDto.IdCard.Substring(userInfoDto.IdCard.Length - 4);
}
var userPlayGameTime = Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == _UserId).SumAsync(it => (int?)it.PlayTime);
//var userPlayGameTime = await Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == _UserId).SumAsync(it => (int?)it.PlayTime);
//userInfoDto.UserPlayGameTime = userPlayGameTime ?? 0;
return userInfoDto;
}

View File

@ -157,8 +157,9 @@ namespace CloudGaming.Code.Account
{
throw MessageBox.Show(ResponseCode.NotFoundRecord, "未找到用户扩展信息");
}
userInfo.LoadUserInfo(user, userData, userCurrency);
var userPlayGameTime = await Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == userId).SumAsync(it => (int?)it.PlayTime);
userInfo.UserPlayGameTime = userPlayGameTime ?? 0;
await cloudGamingBase.RedisCache.StringSetAsync(key, userInfo, TimeSpan.FromHours(1));
}

View File

@ -272,7 +272,7 @@ namespace CloudGaming.Code.Account
if (issuccess)
{
cloudGamingBase.UserInfo.Diamond = (int)currency.CurrencyMoney;
await cloudGamingBase.SaveUserInfoCacheChangesAsync();
//await cloudGamingBase.SaveUserInfoCacheChangesAsync();
UserCurrencyConsumeType consumeType = money >= 0 ? UserCurrencyConsumeType. : UserCurrencyConsumeType.;
T_User_DiamondList userDiamondList = null;
if (diamondListId > 0)

View File

@ -1,4 +1,5 @@
using CloudGaming.Code.Account;
using CloudGaming.Code.AppExtend;
using CloudGaming.Code.Contract;
using CloudGaming.DtoModel.Account.User;
using CloudGaming.DtoModel.Game;
@ -254,6 +255,10 @@ public class PlayGameBLL : CloudGamingBase
{
throw MessageBox.ErrorShow("扣款出现错误");
}
//userInfo
//var userPlayGameTime = await Dao.DaoPhone.Context.T_User_PlayGameTime.Where(it => it.UserId == userId).SumAsync(it => (int?)it.PlayTime);
userInfo.UserPlayGameTime += minutes;
await this.SaveUserInfoCacheChangesAsync();
gameInfoCache.CurrencyLogId = currlogId;
gameInfoCache.DiamondListId = diamId;
//修改最后扣费时间

View File

@ -69,6 +69,11 @@ public class UserInfo
/// </summary>
public UserInfoNightCard NightCard { get; set; } = new UserInfoNightCard();
/// <summary>
/// 用户游玩时间,分钟
/// </summary>
public int UserPlayGameTime { get; set; }
}

View File

@ -54,6 +54,6 @@ namespace CloudGaming.DtoModel.Account.User
/// </summary>
public bool IsPay { get; set; }
}
}

View File

@ -14,6 +14,6 @@ namespace CloudGaming.DtoModel.Account.User
[AutoMap(typeof(UserInfoCache))]
public class UserInfoDto : UserInfo
{
}
}