修改问题
This commit is contained in:
parent
97f4047174
commit
99fafeac96
|
|
@ -267,6 +267,10 @@ namespace CloudGaming.Code.Account
|
|||
if (userCurrency != null)
|
||||
{
|
||||
userInfo.Diamond = (int)userCurrency.GetUserCurrency(UserCurrencyType.钻石);
|
||||
if (userCurrency.TryGetValue(UserCurrencyType.会员卡, out var vipCurrency))
|
||||
{
|
||||
userInfo.UserVipInfo = new UserInfoPlayGameCard(vipCurrency);
|
||||
}
|
||||
}
|
||||
return userInfo;
|
||||
}
|
||||
|
|
@ -325,7 +329,6 @@ namespace CloudGaming.Code.Account
|
|||
if (cloudGamingBase._UserId == 0)
|
||||
{
|
||||
return false;
|
||||
|
||||
}
|
||||
T_User_Messages t_User_Messages = new T_User_Messages()
|
||||
{
|
||||
|
|
@ -357,15 +360,13 @@ namespace CloudGaming.Code.Account
|
|||
int userId = userInfoCache.UserId;
|
||||
if (userInfoCache.BuyProductCount == null)
|
||||
{
|
||||
var orderDictionary = await dao.DaoUser.Context.T_User_Order
|
||||
.Where(it => it.UserId == userId).GroupBy(it => it.ProductId).ToDictionaryAsync(it => it.Key, it => it.Count());
|
||||
var orderDictionary = await dao.DaoUser.Context.T_User_Order.Where(it => it.UserId == userId).GroupBy(it => it.ProductId).ToDictionaryAsync(it => it.Key, it => it.Count());
|
||||
if (orderDictionary == null)
|
||||
{
|
||||
orderDictionary = new Dictionary<string, int>();
|
||||
}
|
||||
userInfoCache.BuyProductCount = orderDictionary;
|
||||
await SaveUserInfoCacheChangesAsync(userInfoCache, database);
|
||||
//new CloudGamingBase().SaveUserInfoCacheChangesAsync();
|
||||
}
|
||||
return userInfoCache.BuyProductCount;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using System.Threading.Tasks;
|
|||
namespace CloudGaming.Code.Account.UserCurrency;
|
||||
|
||||
/// <summary>
|
||||
/// 扣除或者充值用户钻石
|
||||
/// 扣除或者充值用户钻石
|
||||
/// </summary>
|
||||
/// <param name="dao"></param>
|
||||
/// <param name="userId"></param>
|
||||
|
|
@ -41,6 +41,7 @@ public class DiamondConsumeMoney(DAO dao, int userId, UserCurrencyType userCurre
|
|||
Remarks = $"于{DateTime.Now:yyyy-MM-dd HH:mm:ss}{consumeType}[{Math.Abs(money)}]{userCurrencyType};",
|
||||
UpdateAt = DateTime.Now,
|
||||
UserId = userId,
|
||||
|
||||
};
|
||||
await dao.DaoUser.Context.T_User_Currency_Log.AddAsync(currency_Log);
|
||||
await dao.DaoUser.Context.SaveChangesAsync();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,118 @@
|
|||
using CloudGaming.Code.Account.Contract;
|
||||
using CloudGaming.Code.DataAccess;
|
||||
using CloudGaming.DtoModel.Account.User;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CloudGaming.Code.Account.UserCurrency;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dao"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userCurrencyType"></param>
|
||||
/// <param name="userCurrency"></param>
|
||||
public class PlayCardConsumeMoney(DAO dao, int userId, UserCurrencyType userCurrencyType, T_User_Currency userCurrency = null) : IUserConsumeMoney
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户月卡余额
|
||||
/// </summary>
|
||||
/// <param name="money"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
|
||||
public async Task<bool> ConsumeMoneyAsync(decimal money)
|
||||
{
|
||||
decimal tMoney = money;
|
||||
if (userCurrencyType == UserCurrencyType.会员季卡)
|
||||
{
|
||||
tMoney = money * 90;
|
||||
}
|
||||
else if (userCurrencyType == UserCurrencyType.会员月卡)
|
||||
{
|
||||
tMoney = money * 30;
|
||||
}
|
||||
else if (userCurrencyType == UserCurrencyType.会员年卡)
|
||||
{
|
||||
tMoney = money * 365;
|
||||
}
|
||||
else
|
||||
{
|
||||
tMoney = money * 1;
|
||||
}
|
||||
T_User_Currency? currency = await AddUserCurrencyAsync(tMoney);
|
||||
UserCurrencyConsumeType consumeType = money >= 0 ? UserCurrencyConsumeType.收入 : UserCurrencyConsumeType.消耗;
|
||||
var currency_Log = new T_User_Currency_Log()
|
||||
{
|
||||
Consume = money,
|
||||
ConsumeType = (int)consumeType,
|
||||
CreateAt = DateTime.Now,
|
||||
CurrencyType = (int)userCurrencyType,
|
||||
Remarks = $"于{DateTime.Now:yyyy-MM-dd HH:mm:ss}{consumeType}[{Math.Abs(money)}]{userCurrencyType}--{tMoney}天;",
|
||||
UpdateAt = DateTime.Now,
|
||||
UserId = userId,
|
||||
|
||||
};
|
||||
await dao.DaoUser.Context.T_User_Currency_Log.AddAsync(currency_Log);
|
||||
await dao.DaoUser.Context.SaveChangesAsync();
|
||||
if (userCurrency != null)
|
||||
{
|
||||
userCurrency.CurrencyMoney = currency.CurrencyMoney;
|
||||
userCurrency.UpdateAt = currency.UpdateAt;
|
||||
userCurrency.Id = currency.Id;
|
||||
userCurrency.CurrencyName = currency.CurrencyName;
|
||||
userCurrency.CreateAt = currency.CreateAt;
|
||||
userCurrency.CurrencyType = currency.CurrencyType;
|
||||
userCurrency.ExpirationAt = currency.ExpirationAt;
|
||||
}
|
||||
else
|
||||
{
|
||||
userCurrency = currency;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="money"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public async Task<T_User_Currency?> AddUserCurrencyAsync(decimal money)
|
||||
{
|
||||
var currency = await dao.DaoUser.Context.T_User_Currency.Where(it => it.CurrencyType == (int)UserCurrencyType.会员卡 && it.UserId == userId).FirstOrDefaultAsync();
|
||||
if (currency == null)
|
||||
{
|
||||
currency = new T_User_Currency()
|
||||
{
|
||||
CreateAt = DateTime.Now,
|
||||
CurrencyMoney = 0,
|
||||
CurrencyName = userCurrencyType.ToString(),
|
||||
CurrencyType = (int)UserCurrencyType.会员卡,
|
||||
UserId = userId,
|
||||
UpdateAt = DateTime.Now,
|
||||
ExpirationAt = DateTime.Now,
|
||||
};
|
||||
await dao.DaoUser.Context.T_User_Currency.AddAsync(currency);
|
||||
await dao.DaoUser.Context.SaveChangesAsync();
|
||||
}
|
||||
currency.CurrencyMoney += money;
|
||||
if (currency.ExpirationAt == null || currency.ExpirationAt.Value < DateTime.Now)
|
||||
{
|
||||
currency.ExpirationAt = DateTime.Now;
|
||||
currency.CurrencyName = userCurrencyType.ToString();
|
||||
}
|
||||
currency.ExpirationAt = currency.ExpirationAt.Value.AddDays((double)money);
|
||||
if (currency.CurrencyMoney < 0)
|
||||
{
|
||||
throw new Exception("余额不足");
|
||||
}
|
||||
|
||||
return currency;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
using Bogus.DataSets;
|
||||
|
||||
using CloudGaming.Code.Account.Contract;
|
||||
using CloudGaming.Code.Account.UserCurrency;
|
||||
using CloudGaming.Code.AppExtend;
|
||||
using CloudGaming.Code.DataAccess;
|
||||
using CloudGaming.DtoModel.Account.User;
|
||||
|
||||
|
|
@ -98,12 +101,26 @@ namespace CloudGaming.Code.Account
|
|||
/// <param name="userCurrencyType"></param>
|
||||
/// <returns></returns>
|
||||
public static IUserConsumeMoney GetCurrentUserConsumeMoney(this CloudGamingBase cloudGamingBase, UserCurrencyType userCurrencyType, T_User_Currency currency = null)
|
||||
{
|
||||
return GetCurrentUserConsumeMoney(cloudGamingBase.Dao, cloudGamingBase._UserId, userCurrencyType, currency);
|
||||
}
|
||||
/// <summary>
|
||||
/// 扣除当前用户钻石
|
||||
/// </summary>
|
||||
/// <param name="cloudGamingBase"></param>
|
||||
/// <param name="userCurrencyType"></param>
|
||||
/// <returns></returns>
|
||||
public static IUserConsumeMoney GetCurrentUserConsumeMoney(DAO dao, int userId, UserCurrencyType userCurrencyType, T_User_Currency currency = null)
|
||||
{
|
||||
if (UserCurrencyType.钻石 == userCurrencyType)
|
||||
{
|
||||
return new DiamondConsumeMoney(cloudGamingBase.Dao, cloudGamingBase._UserId, userCurrencyType, currency);
|
||||
return new DiamondConsumeMoney(dao, userId, userCurrencyType, currency);
|
||||
}
|
||||
return new DiamondConsumeMoney(cloudGamingBase.Dao, cloudGamingBase._UserId, userCurrencyType, currency);
|
||||
else if (userCurrencyType == UserCurrencyType.会员卡 || userCurrencyType == UserCurrencyType.会员季卡 || userCurrencyType == UserCurrencyType.会员月卡 || userCurrencyType == UserCurrencyType.会员年卡)
|
||||
{
|
||||
return new PlayCardConsumeMoney(dao, userId, userCurrencyType, currency);
|
||||
}
|
||||
return new DiamondConsumeMoney(dao, userId, userCurrencyType, currency);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -114,11 +131,8 @@ namespace CloudGaming.Code.Account
|
|||
/// <returns></returns>
|
||||
public static IUserConsumeMoney CurrentUserConsumeMoney(this UserInfoCache userInfo, CloudGamingBase cloudGamingBase, UserCurrencyType userCurrencyType, T_User_Currency currency = null)
|
||||
{
|
||||
if (UserCurrencyType.钻石 == userCurrencyType)
|
||||
{
|
||||
return new DiamondConsumeMoney(cloudGamingBase.Dao, userInfo.UserId, userCurrencyType, currency);
|
||||
}
|
||||
return new DiamondConsumeMoney(cloudGamingBase.Dao, cloudGamingBase._UserId, userCurrencyType, currency);
|
||||
return GetCurrentUserConsumeMoney(cloudGamingBase.Dao, userInfo.UserId, userCurrencyType, currency);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -198,19 +212,52 @@ namespace CloudGaming.Code.Account
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 畅玩卡
|
||||
/// </summary>
|
||||
/// <param name="cloudGamingBase"></param>
|
||||
/// <param name="money">金额</param>
|
||||
/// <param name="title">资产支出标题</param>
|
||||
/// <param name="orderId">订单号</param>
|
||||
/// <param name="dao"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="money"></param>
|
||||
/// <param name="userCurrencyType"></param>
|
||||
/// <param name="userDoamondAction"></param>
|
||||
/// <param name="userCurrency"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public static async Task<bool> UserConsumeDiamondMoneyAsync(this CloudGamingBase cloudGamingBase, decimal money, string title = "", string orderId = "")
|
||||
public static async Task<bool> UserConsumePlayGameMoneyAsync(DAO dao, int userId, decimal money, UserCurrencyType userCurrencyType, Action<T_User_DiamondList>? userDoamondAction = null, T_User_Currency userCurrency = null)
|
||||
{
|
||||
return await UserConsumeDiamondMoneyAsync(cloudGamingBase, money, it => { it.Title = title; it.OrderCode = orderId; });
|
||||
|
||||
var userConsumeMoney = GetCurrentUserConsumeMoney(dao, userId, userCurrencyType, userCurrency);
|
||||
try
|
||||
{
|
||||
var isSuccess = await userConsumeMoney.ConsumeMoneyAsync(money);
|
||||
if (!isSuccess)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
UserCurrencyConsumeType consumeType = money >= 0 ? UserCurrencyConsumeType.收入 : UserCurrencyConsumeType.消耗;
|
||||
T_User_DiamondList userDiamondList = new T_User_DiamondList()
|
||||
{
|
||||
CreateAt = DateTime.Now,
|
||||
Consume = money,
|
||||
ConsumeType = (int)consumeType,
|
||||
CurrencyType = (int)userCurrencyType,
|
||||
OrderCode = "",
|
||||
Title = "",
|
||||
UpdateAt = DateTime.Now,
|
||||
UserId = userId,
|
||||
};
|
||||
if (userDoamondAction != null)
|
||||
{
|
||||
userDoamondAction(userDiamondList);
|
||||
}
|
||||
await dao.DaoUser.Context.AddAsync(userDiamondList);
|
||||
await dao.DaoUser.Context.SaveChangesAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -228,6 +275,18 @@ namespace CloudGaming.Code.Account
|
|||
{
|
||||
return await UserConsumeDiamondMoneyAsync(cloudGamingBase, money, it => { it.Title = title; it.OrderCode = orderId; });
|
||||
}
|
||||
else if (userCurrencyType == UserCurrencyType.会员卡 || userCurrencyType == UserCurrencyType.会员季卡 || userCurrencyType == UserCurrencyType.会员月卡 || userCurrencyType == UserCurrencyType.会员年卡)
|
||||
{
|
||||
var cu = new T_User_Currency();
|
||||
var isSuccess = await UserConsumePlayGameMoneyAsync(cloudGamingBase.Dao, cloudGamingBase._UserId, money, userCurrencyType, it => { it.Title = title; it.OrderCode = orderId; }, cu);
|
||||
if (isSuccess)
|
||||
{
|
||||
|
||||
cloudGamingBase.UserInfo.UserVipInfo = new UserInfoPlayGameCard(cu);
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
|
||||
return await UserConsumeDiamondMoneyAsync(cloudGamingBase, money, it => { it.Title = title; it.OrderCode = orderId; });
|
||||
}
|
||||
/// <summary>
|
||||
|
|
@ -247,6 +306,10 @@ namespace CloudGaming.Code.Account
|
|||
{
|
||||
return await UserConsumeDiamondMoneyAsync(dao, userId, money, it => { it.Title = title; it.OrderCode = orderId; }, currency);
|
||||
}
|
||||
else if (userCurrencyType == UserCurrencyType.会员卡 || userCurrencyType == UserCurrencyType.会员季卡 || userCurrencyType == UserCurrencyType.会员月卡 || userCurrencyType == UserCurrencyType.会员年卡)
|
||||
{
|
||||
return await UserConsumePlayGameMoneyAsync(dao, userId, money, userCurrencyType, it => { it.Title = title; it.OrderCode = orderId; }, currency);
|
||||
}
|
||||
return await UserConsumeDiamondMoneyAsync(dao, userId, money, it => { it.Title = title; it.OrderCode = orderId; }, currency);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,11 @@ namespace CloudGaming.Code.Game
|
|||
/// <returns></returns>
|
||||
public List<GameListDto> GameRecommendations(string gameId)
|
||||
{
|
||||
var size = 3;
|
||||
if (AppRequestInfo.Platform == AppPlatform.tv.ToString() || AppRequestInfo.Platform == AppPlatform.car.ToString())
|
||||
{
|
||||
size = 5;
|
||||
}
|
||||
List<GameInfo>? gameInfos = null;
|
||||
if (!string.IsNullOrEmpty(gameId))
|
||||
{
|
||||
|
|
@ -114,13 +119,13 @@ namespace CloudGaming.Code.Game
|
|||
if (game != null)
|
||||
{
|
||||
var gameTagIds = game.GameTags.Select(it => it.Id);
|
||||
gameInfos = Cache.GameInfos.Where(it => it.GameTags.Any(tag => gameTagIds.Contains(tag.Id))).OrderBy(it => Guid.NewGuid()).Take(3).ToList();
|
||||
gameInfos = Cache.GameInfos.Where(it => it.GameTags.Any(tag => gameTagIds.Contains(tag.Id))).OrderBy(it => Guid.NewGuid()).Take(size).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
if (gameInfos == null || gameInfos.Count == 0)
|
||||
{
|
||||
gameInfos = Cache.GameInfos.OrderBy(it => Guid.NewGuid()).Take(3).ToList();
|
||||
gameInfos = Cache.GameInfos.OrderBy(it => Guid.NewGuid()).Take(size).ToList();
|
||||
}
|
||||
var gameList = gameInfos?.Select(it => new GameListDto(it, ImageResStyle.竖形图)).ToList();
|
||||
return gameList ?? new List<GameListDto>();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ using System.Drawing;
|
|||
Console.WriteLine("Hello, World!");
|
||||
// 设置 ExcelPackage 的许可
|
||||
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
|
||||
string directoryPath = "C:\\Users\\Administrator\\Pictures\\游戏运营配图\\";
|
||||
string directoryPath = "C:\\Users\\Administrator\\Pictures\\车机版\\游戏运营配图\\";
|
||||
string filePath = $"{directoryPath}游戏列表.xlsx";
|
||||
|
||||
// 确保文件存在
|
||||
|
|
@ -263,10 +263,10 @@ tempGames.ForEach((Action<tempGame>)(game =>
|
|||
}
|
||||
}
|
||||
//添加游戏类型
|
||||
gameDao.SaveChanges();
|
||||
//gameDao.SaveChanges();
|
||||
//添加配置表
|
||||
var gameCbtOrderId = (gameCbt.Max(it => (int?)it.OrderId) ?? 0) + 1;
|
||||
var gameCbt1 = gameCbt.FirstOrDefault(it => it.GameId == game.GameId);
|
||||
var gameCbt1 = gameCbt.FirstOrDefault(it => it.GameId == game.GameId&&it.OnlinePlatform== AppPlatform.car.ToString());
|
||||
if (gameCbt1 == null)
|
||||
{
|
||||
gameCbt1 = new T_GameCBT()
|
||||
|
|
@ -312,21 +312,21 @@ tempGames.ForEach((Action<tempGame>)(game =>
|
|||
gameCbt1.ConsumeDiamondNumHour = game.ConsumeDiamondNumHour;
|
||||
//cbtDao.T_App_Image
|
||||
T_App_Image banner = AddImage(game, "banner.png");
|
||||
T_App_Image jiazuo = AddImage(game, "jiazuo.png");
|
||||
T_App_Image logo_1 = AddImage(game, "log.png");
|
||||
T_App_Image logo_2 = AddImage(game, "log.png");
|
||||
T_App_Image logo_3 = AddImage(game, "renmen.png");
|
||||
T_App_Image biwan = AddImage(game, "biwan.png");
|
||||
T_App_Image logo_1 = AddImage(game, "logo_1.png");
|
||||
T_App_Image logo_2 = AddImage(game, "logo_2.png");
|
||||
T_App_Image logo_3 = AddImage(game, "logo_3.png");
|
||||
T_App_Image xilie = AddImage(game, "xilie.png");
|
||||
T_App_Image youxiku = AddImage(game, "youxiku.png");
|
||||
//T_App_Image youxiku = AddImage(game, "youxiku.png");
|
||||
cbtDao.SaveChanges();
|
||||
gameCbt1.ImageId_Banner = banner.ImageId;
|
||||
gameCbt1.GameBgImgId = banner.ImageId;
|
||||
gameCbt1.ImageIconId = logo_1.ImageId;
|
||||
gameCbt1.ImageId_RM = logo_3.ImageId;
|
||||
gameCbt1.ImageId_ShouSuo = logo_2.ImageId;
|
||||
gameCbt1.ImageId_YXK = youxiku.ImageId;
|
||||
gameCbt1.ImageId_FK = xilie.ImageId;
|
||||
gameCbt1.ImageId_TJ = biwan.ImageId;
|
||||
gameCbt1.ImageId_YXK = logo_3.ImageId;
|
||||
gameCbt1.ImageId_FK = biwan.ImageId;
|
||||
gameCbt1.ImageId_TJ = jiazuo.ImageId;
|
||||
gameCbtOrderId++;
|
||||
appDao.SaveChanges();
|
||||
|
||||
|
|
@ -341,7 +341,7 @@ T_App_Image AddImage(tempGame game, string image)
|
|||
Language = "zh",
|
||||
Name = game.GameName,
|
||||
UpdateTime = DateTime.Now,
|
||||
Url = $"cloudgame/images/game/{game.GameId}/{image}",
|
||||
Url = $"cloudgame/images/game/car/{game.GameId}/{image}",
|
||||
ImageId = imageId
|
||||
};
|
||||
imageId++;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,23 @@ namespace CloudGaming.DtoModel.Account.User
|
|||
/// <summary>
|
||||
/// 钻石
|
||||
/// </summary>
|
||||
钻石 = 0
|
||||
钻石 = 0,
|
||||
/// <summary>
|
||||
/// 会员卡
|
||||
/// </summary>
|
||||
会员卡 = 200,
|
||||
/// <summary>
|
||||
/// 会员月卡
|
||||
/// </summary>
|
||||
会员月卡 = 201,
|
||||
/// <summary>
|
||||
/// 会员季卡
|
||||
/// </summary>
|
||||
会员季卡 = 202,
|
||||
/// <summary>
|
||||
/// 会员年卡
|
||||
/// </summary>
|
||||
会员年卡 = 203,
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
using CloudGaming.Model.DbSqlServer.Db_User;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -70,6 +72,11 @@ public class UserInfo
|
|||
|
||||
public UserInfoNightCard NightCard { get; set; } = new UserInfoNightCard();
|
||||
|
||||
/// <summary>
|
||||
/// 用户vip信息
|
||||
/// </summary>
|
||||
public UserInfoPlayGameCard UserVipInfo { get; set; } = new UserInfoPlayGameCard();
|
||||
|
||||
/// <summary>
|
||||
/// 用户游玩时间,分钟
|
||||
/// </summary>
|
||||
|
|
@ -92,4 +99,61 @@ public class UserInfoNightCard
|
|||
/// 包夜卡过期时间
|
||||
/// </summary>
|
||||
public string NightCardExpireDateTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 会员卡
|
||||
/// </summary>
|
||||
public class UserInfoPlayGameCard
|
||||
{
|
||||
public UserInfoPlayGameCard()
|
||||
{
|
||||
VipNameTips = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="t_User_Currency"></param>
|
||||
public UserInfoPlayGameCard(T_User_Currency t_User_Currency)
|
||||
{
|
||||
if (t_User_Currency != null && t_User_Currency.CurrencyType == (int)UserCurrencyType.会员卡)
|
||||
{
|
||||
if (t_User_Currency.ExpirationAt != null && t_User_Currency.ExpirationAt.Value > DateTime.Now)
|
||||
{
|
||||
ExpireDateTime = t_User_Currency.ExpirationAt;
|
||||
VipNameTips = t_User_Currency.CurrencyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool isVip;
|
||||
/// <summary>
|
||||
/// 是否是vip用户
|
||||
/// </summary>
|
||||
public bool IsVip
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.ExpireDateTime != null && this.ExpireDateTime.Value > DateTime.Now)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
isVip = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vip过期时间
|
||||
/// </summary>
|
||||
public DateTime? ExpireDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// vip显示提示
|
||||
/// </summary>
|
||||
public string VipNameTips { get; set; }
|
||||
|
||||
}
|
||||
|
|
@ -53,7 +53,5 @@ namespace CloudGaming.DtoModel.Account.User
|
|||
/// 是否付费
|
||||
/// </summary>
|
||||
public bool IsPay { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ namespace CloudGaming.DtoModel.Epg
|
|||
/// 主页使用
|
||||
/// </summary>
|
||||
系类 = 6,
|
||||
/// <summary>
|
||||
/// 背景图
|
||||
/// </summary>
|
||||
Banner = 7,
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -124,6 +128,7 @@ namespace CloudGaming.DtoModel.Epg
|
|||
var style when style == ImageResStyle.游戏库 => gameInfo?.ImageId_YXK,
|
||||
var style when style == ImageResStyle.竖形图 => gameInfo?.ImageId_TJ,
|
||||
var style when style == ImageResStyle.系类 => gameInfo?.ImageId_FK,
|
||||
var style when style == ImageResStyle.Banner => gameInfo?.GameBgImgId,
|
||||
_ => 0
|
||||
} ?? 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
|
|
@ -174,6 +174,9 @@ public partial class CloudGamingUserContext : MultiTenantDbContext//DbContext
|
|||
.HasComment("货币名称")
|
||||
.UseCollation("Chinese_PRC_CI_AS");
|
||||
entity.Property(e => e.CurrencyType).HasComment("货币类型 付费币、免费币");
|
||||
entity.Property(e => e.ExpirationAt)
|
||||
.HasComment("过期时间")
|
||||
.HasColumnType("datetime");
|
||||
entity.Property(e => e.TenantId).HasComment("租户Id");
|
||||
entity.Property(e => e.UpdateAt)
|
||||
.HasComment("修改时间")
|
||||
|
|
|
|||
|
|
@ -45,4 +45,9 @@ public partial class T_User_Currency: MultiTenantEntity
|
|||
/// 所属租户
|
||||
/// </summary>
|
||||
public override Guid TenantId { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public virtual DateTime? ExpirationAt { get; set; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user