This commit is contained in:
2026-07-15 23:04:46 +08:00
parent 4ef892e15e
commit c94b3ce200
28 changed files with 562 additions and 10 deletions

View File

@@ -186,17 +186,22 @@ public class TradeController : ControllerBase
if (info.code == nameof(GameEnum.PropCode.Equ))
{
unit_user_equ equInfo = JsonConvert.DeserializeObject<unit_user_equ>(info.content);
if (await _weightService.CheckUserWeight(userId, (int)equInfo.weight)==false)
{
return PoAction.Message("您的负重不足!");
}
var myAcc = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
if (myAcc < info.price)
{
return PoAction.Message("您的铜贝不足!");
}
if (await _accService.UpdateUserCopper(userId, 0, (long)info.price, $"交易支付:{info.name}"))
{
if (await _tradeService.UpdateTradeCount(info.tradeId, 0, 1, true))
{
unit_user_equ equInfo = JsonConvert.DeserializeObject<unit_user_equ>(info.content);
equInfo.userId = userId;
await _equService.AddUserEqu(equInfo, "交易获得");
long GetCopper = Convert.ToInt64(info.price * 0.9M);
@@ -220,6 +225,12 @@ public class TradeController : ControllerBase
}
else if (info.code == nameof(GameEnum.PropCode.Goods))
{
var goodsInfo = await _goodsService.GetGoodsInfo(Convert.ToInt32(info.propId));
int needWeight = (int)goodsInfo.weight * count;
if (await _weightService.CheckUserWeight(userId, needWeight)==false)
{
return PoAction.Message("您的负重不足!");
}
var myAcc = await _accService.GetUserAccInfo(userId, nameof(AccEnum.AccType.copper));
var needCopper = Convert.ToInt64(info.price) * count;
if (myAcc < needCopper)