diff --git a/Server/Service/BuyShopItem.cs b/Server/Service/BuyShopItem.cs index 7433637..8bbc270 100644 --- a/Server/Service/BuyShopItem.cs +++ b/Server/Service/BuyShopItem.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using Server.SQL; using Server.Manager; using NLog; +using System.Diagnostics; namespace Server.Service { @@ -15,6 +16,7 @@ namespace Server.Service { Statics.userSQL.SaveChanges(); Statics.resetShopItemSQL.SaveChanges(); + Statics.shopItemSQL.SaveChanges(); item.box.SaveSQL(); } @@ -26,7 +28,7 @@ namespace Server.Service long reward; long id; ResetShopItem resetShopItem = null; - if (req.reset_id == 0) + if (req.reset_id == -1) { ShopItemData shopItemData = Statics.shopItemExcel.getShopItemData(req.shopItemIndex); buy_type = shopItemData.buy_type; @@ -69,11 +71,12 @@ namespace Server.Service if (reward != 0) { item.addReward(reward); - ShopItem shopItem = new ShopItem(); if(resetShopItem == null) { + ShopItem shopItem = new ShopItem(); shopItem.user_id = user.id; shopItem.shop_item_data_id = id; + shopItem.buy_date = DateTime.UtcNow; Statics.shopItemSQL.Insert(shopItem); } else