diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs index c39d204..9953aae 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs @@ -173,16 +173,20 @@ namespace HuanMeng.MiaoYu.Code.Users { return new BaseResponse>(ResonseCode.Success, "", new List()); } - var logs = await Dao.daoDbMiaoYu.context.T_User_Currency_Log.Where(it => it.UserId == _UserId && (it.CurrencyType == (int)UserCurrencyType.聊天次数 && it.ConsumeType == 1) && !it.IsHide).OrderByDescending(it => it.Id).Take(50).ToListAsync(); + var logs = await Dao.daoDbMiaoYu.context.T_User_Currency_Log.Where(it => it.UserId == _UserId && !(it.CurrencyType == (int)UserCurrencyType.聊天次数 && it.ConsumeType == 0) && !it.IsHide).OrderByDescending(it => it.Id).Take(50).ToListAsync(); List list = new List(); foreach (var item in logs) { + if (string.IsNullOrEmpty(item.Title)) + { + continue; + } TransactionDto transactionDto = new TransactionDto(); transactionDto.TransactionType = 0; transactionDto.TransactionTime = item.CreateTime; transactionDto.CurrencyType = item.CurrencyType; transactionDto.TransactionContent = item.Title; - transactionDto.TransactionAmount = $"{(item.Consume > 0 ? "+" : "")}{item.Consume:D2}{(item.CurrencyType == 1 ? UserCurrencyType.语珠.ToString() : "")}"; + transactionDto.TransactionAmount = $"{(item.Consume > 0 ? "+" : "")}{item.Consume.ToString("0.##")}{(item.CurrencyType == 1 ? UserCurrencyType.语珠.ToString() : "")}"; list.Add(transactionDto); } return new BaseResponse>(ResonseCode.Success, "", list);