39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Newtonsoft.Json;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Server.SQL
|
|
{
|
|
[Table("reset_shop_item", Schema = "gamedb")]
|
|
public class ResetShopItem
|
|
{
|
|
[JsonIgnore]
|
|
public long user_id { get; set; }
|
|
public long id { get; set; }
|
|
public long reset_shop_item_data_id { get; set; }
|
|
public string name { get; set; }
|
|
public long shop_index { get; set; }
|
|
public eBuyType buy_type { get; set; }
|
|
public int buy { get; set; }
|
|
public long reward { get; set; }
|
|
public int buy_count { get; set; }
|
|
public int count { get; set; }
|
|
public DateTime end_date { get; set; }
|
|
}
|
|
|
|
public class ResetShopItemSQL : SQL<ResetShopItem>
|
|
{
|
|
public override DbSet<ResetShopItem> table { get; set; }
|
|
|
|
public void Update(ResetShopItem ResetShopItem)
|
|
{
|
|
table.Update(ResetShopItem);
|
|
}
|
|
|
|
public override List<ResetShopItem> SelectUid(long user_id)
|
|
{
|
|
return table.Where(data => data.user_id == user_id && data.end_date > DateTime.UtcNow).ToList();
|
|
}
|
|
}
|
|
}
|