mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-20 11:09:35 +08:00

* 补充数据库表 * 更新sqlite * 添加商店相关的数据库常量类 * add Update_UpdateRoomMaster * 修改常量类 * 添加 NOTICE 文件 * 添加市场、报价、库存的数据库常量类 * 优化表结构和查询常量类 * 添加 UserCenter 和 Inventory 相关枚举;数据表和 Query 常量类修改 * 添加报价的核心操作 * 涉及库存的物品获取应该使用 Guid 而不是 ItemId --------- Co-authored-by: yeziuku <yezi@wrss.org>
44 lines
1.9 KiB
C#
44 lines
1.9 KiB
C#
using Milimoe.FunGame.Core.Api.Transmittal;
|
|
|
|
namespace Milimoe.FunGame.Core.Library.SQLScript.Common
|
|
{
|
|
public class UserSignIns : Constant
|
|
{
|
|
public const string TableName = "UserSignIns";
|
|
public const string Column_UserId = "UserId";
|
|
public const string Column_LastTime = "LastTime";
|
|
public const string Column_Days = "Days";
|
|
public const string Column_IsSigned = "IsSigned";
|
|
|
|
public static string Insert_NewUserSignIn(SQLHelper SQLHelper, long UserId)
|
|
{
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
SQLHelper.Parameters["@LastTime"] = DBNull.Value;
|
|
SQLHelper.Parameters["@Days"] = 0;
|
|
SQLHelper.Parameters["@IsSigned"] = 0;
|
|
return $"{Command_Insert} {Command_Into} {TableName} ({Column_UserId}, {Column_LastTime}, {Column_Days}, {Column_IsSigned}) {Command_Values} (@UserId, @LastTime, @Days, @IsSigned)";
|
|
}
|
|
|
|
public static string Select_GetUserSignIn(SQLHelper SQLHelper, long UserId)
|
|
{
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
return $"{Command_Select} {Command_All} {Command_From} {TableName} {Command_Where} {Column_UserId} = @UserId";
|
|
}
|
|
|
|
public static string Update_UserSignIn(SQLHelper SQLHelper, long UserId, int Days)
|
|
{
|
|
SQLHelper.Parameters["@UserId"] = UserId;
|
|
SQLHelper.Parameters["@LastTime"] = DateTime.Now;
|
|
SQLHelper.Parameters["@Days"] = Days;
|
|
SQLHelper.Parameters["@IsSigned"] = 1;
|
|
return $"{Command_Update} {TableName} {Command_Set} {Column_LastTime} = @LastTime, {Column_Days} = @Days, {Column_IsSigned} = @IsSigned {Command_Where} {Column_UserId} = @UserId";
|
|
}
|
|
|
|
public static string Update_ResetStatus(SQLHelper SQLHelper)
|
|
{
|
|
SQLHelper.Parameters["@IsSigned"] = 0;
|
|
return $"{Command_Update} {TableName} {Command_Set} {Column_IsSigned} = @IsSigned";
|
|
}
|
|
}
|
|
}
|