修改问题
This commit is contained in:
parent
b1f56c46b9
commit
fd623af85b
|
|
@ -221,10 +221,21 @@ namespace HuanMeng.MiaoYu.Code.Music
|
||||||
{
|
{
|
||||||
throw new Exception("请先登录");
|
throw new Exception("请先登录");
|
||||||
}
|
}
|
||||||
UserInfoBLL userInfoBLL = new UserInfoBLL(Dao, _UserId);
|
var songVip = Dao.daoDbMiaoYu.context.M_SongVIP.FirstOrDefault(it => it.UserId == _UserId && it.ExpirationAt > DateTime.Now);
|
||||||
if (!userInfoBLL.IsCheckingSufficient(UserCurrencyType.音乐点数, 10))
|
bool isSongVip = false;
|
||||||
|
if (songVip != null)
|
||||||
{
|
{
|
||||||
throw new Exception("音乐点数不足");
|
isSongVip = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UserInfoBLL userInfoBLL = new UserInfoBLL(Dao, _UserId);
|
||||||
|
if (!isSongVip)
|
||||||
|
{
|
||||||
|
if (!userInfoBLL.IsCheckingSufficient(UserCurrencyType.音乐点数, 10))
|
||||||
|
{
|
||||||
|
throw new Exception("音乐点数不足");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool isGenresId = false;
|
bool isGenresId = false;
|
||||||
var genresId = MiaoYuCacheExtend.GetMiaoYuDataEntityCacheList<M_MusicGenres>(this, it => it.IsEnabled)?.FirstOrDefault(it => it.GenreName == musicCreateRequest.GenreName)?.Id;
|
var genresId = MiaoYuCacheExtend.GetMiaoYuDataEntityCacheList<M_MusicGenres>(this, it => it.IsEnabled)?.FirstOrDefault(it => it.GenreName == musicCreateRequest.GenreName)?.Id;
|
||||||
|
|
@ -292,7 +303,29 @@ namespace HuanMeng.MiaoYu.Code.Music
|
||||||
Dao.daoDbMiaoYu.context.Add(song2);
|
Dao.daoDbMiaoYu.context.Add(song2);
|
||||||
}
|
}
|
||||||
//扣除货币
|
//扣除货币
|
||||||
userInfoBLL[UserCurrencyType.音乐点数].ConsumeMoneyNoWork(-10, Dao);
|
if (!isSongVip)
|
||||||
|
{
|
||||||
|
userInfoBLL[UserCurrencyType.音乐点数].ConsumeMoneyNoWork(-10, Dao);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var log = new T_User_Currency_Log()
|
||||||
|
{
|
||||||
|
Consume = 0,
|
||||||
|
ConsumeType = 0,
|
||||||
|
CreateTime = DateTime.Now,
|
||||||
|
CurrencyType = (int)UserCurrencyType.音乐点数,
|
||||||
|
|
||||||
|
UpdateTime = DateTime.Now,
|
||||||
|
UserId = _UserId,
|
||||||
|
Remarks = "会员生成音乐",
|
||||||
|
Title = "音乐生成",
|
||||||
|
OrderId = "",
|
||||||
|
IsHide = false
|
||||||
|
};
|
||||||
|
Dao.daoDbMiaoYu.context.T_User_Currency_Log.Add(log);
|
||||||
|
}
|
||||||
|
|
||||||
Dao.daoDbMiaoYu.context.SaveChanges();
|
Dao.daoDbMiaoYu.context.SaveChanges();
|
||||||
return new BaseResponse<int>(ResonseCode.Success, "音乐正在生成", m_SongInfo.Id) { };
|
return new BaseResponse<int>(ResonseCode.Success, "音乐正在生成", m_SongInfo.Id) { };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user