游戏收藏功能fixed

This commit is contained in:
sin365 2025-01-09 15:40:46 +08:00
parent e649104475
commit ad6fa8fc86
5 changed files with 34 additions and 6 deletions

View File

@ -136,11 +136,11 @@ namespace AxibugEmuOnline.Server.Manager
MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart"); MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart");
try try
{ {
string query = $"SELECT count(id) from rom_stars where uid = ?uid and = ?romid"; string query = $"SELECT count(id) from rom_stars where uid = ?uid and romid = ?romid";
using (var command = new MySqlCommand(query, conn)) using (var command = new MySqlCommand(query, conn))
{ {
// 设置参数值 // 设置参数值
command.Parameters.AddWithValue("?RomID", RomId); command.Parameters.AddWithValue("?romid", RomId);
command.Parameters.AddWithValue("?uid", uid); command.Parameters.AddWithValue("?uid", uid);
// 执行查询并处理结果 // 执行查询并处理结果
using (var reader = command.ExecuteReader()) using (var reader = command.ExecuteReader())

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net8.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2025-01-09T06:39:17.5797829Z||;True|2025-01-09T14:39:05.6042660+08:00||;True|2025-01-09T14:33:09.1944386+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

View File

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<History>True|2025-01-08T15:13:47.7309044Z||;True|2025-01-08T13:32:52.0590130+08:00||;True|2025-01-08T13:31:56.8589678+08:00||;True|2025-01-07T13:54:02.0272718+08:00||;True|2025-01-07T10:47:36.6196477+08:00||;True|2025-01-07T01:21:34.5863249+08:00||;False|2025-01-07T01:20:39.5344134+08:00||;True|2025-01-07T00:21:47.4863058+08:00||;True|2025-01-07T00:16:42.7998249+08:00||;False|2025-01-07T00:16:02.8107509+08:00||;False|2025-01-02T15:36:18.1906464+08:00||;False|2025-01-02T15:36:06.5622643+08:00||;True|2024-12-27T18:24:49.7554320+08:00||;</History> <History>True|2025-01-09T07:02:05.2160606Z||;True|2025-01-09T14:48:42.5299550+08:00||;False|2025-01-09T14:48:02.6306184+08:00||;True|2025-01-09T14:17:00.2185117+08:00||;True|2025-01-08T23:13:47.7309044+08:00||;True|2025-01-08T13:32:52.0590130+08:00||;True|2025-01-08T13:31:56.8589678+08:00||;True|2025-01-07T13:54:02.0272718+08:00||;True|2025-01-07T10:47:36.6196477+08:00||;True|2025-01-07T01:21:34.5863249+08:00||;False|2025-01-07T01:20:39.5344134+08:00||;True|2025-01-07T00:21:47.4863058+08:00||;True|2025-01-07T00:16:42.7998249+08:00||;False|2025-01-07T00:16:02.8107509+08:00||;False|2025-01-02T15:36:18.1906464+08:00||;False|2025-01-02T15:36:06.5622643+08:00||;True|2024-12-27T18:24:49.7554320+08:00||;</History>
<LastFailureDetails /> <LastFailureDetails />
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -206,7 +206,12 @@ namespace AxibugEmuOnline.Web.Controllers
string HotOrderBy = "ORDER BY playcount DESC, id ASC"; string HotOrderBy = "ORDER BY playcount DESC, id ASC";
query = $"SELECT romlist.id,romlist.`Name`,romlist.GameType,romlist.Note,romlist.RomUrl,romlist.ImgUrl,romlist.`Hash`,romlist.`playcount`,romlist.`stars`,romlist.`PlatformType` from rom_stars LEFT JOIN romlist on romlist.Id = rom_stars.id where rom_stars.uid = ?uid and romlist.`Name` like ?searchPattern {platformCond} {GameTypeCond} {HotOrderBy} LIMIT ?offset, ?pageSize;"; query = @$"SELECT romlist.id,romlist.`Name`,romlist.GameType,romlist.Note,romlist.RomUrl,romlist.ImgUrl,romlist.`Hash`,romlist.`playcount`,romlist.`stars`,romlist.`PlatformType`
from rom_stars
LEFT JOIN romlist on romlist.Id = rom_stars.romid
where rom_stars.uid = ?uid
and romlist.`Name` like ?searchPattern {platformCond} {GameTypeCond} {HotOrderBy}
LIMIT ?offset, ?pageSize;";
using (var command = new MySqlCommand(query, conn)) using (var command = new MySqlCommand(query, conn))
{ {
// 设置参数值 // 设置参数值
@ -325,11 +330,11 @@ namespace AxibugEmuOnline.Web.Controllers
MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart"); MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart");
try try
{ {
string query = $"SELECT count(0) from rom_stars where uid = ?uid and = ?romid"; string query = $"SELECT count(0) from rom_stars where uid = ?uid and romid = ?romid";
using (var command = new MySqlCommand(query, conn)) using (var command = new MySqlCommand(query, conn))
{ {
// 设置参数值 // 设置参数值
command.Parameters.AddWithValue("?RomID", RomId); command.Parameters.AddWithValue("?romid", RomId);
command.Parameters.AddWithValue("?uid", uid); command.Parameters.AddWithValue("?uid", uid);
// 执行查询并处理结果 // 执行查询并处理结果
using (var reader = command.ExecuteReader()) using (var reader = command.ExecuteReader())