20 lines
878 B
C#
20 lines
878 B
C#
namespace Application.Domain;
|
|
|
|
public class GameStoreService(ISqlSugarClient DbClient, IRedisCache redis) : IGameStoreService, ITransient
|
|
{
|
|
public async Task<List<game_city_npc_store>> GetStoreData(int npc, int area, int page, int limit,
|
|
RefAsync<int> total)
|
|
{
|
|
string _area = area.ToString();
|
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_city_npc_store>();
|
|
return await db.Queryable<game_city_npc_store>()
|
|
.Where(it => it.npcId == npc && (it.areaId == "0" || it.areaId == _area))
|
|
.ToPageListAsync(page, limit, total);
|
|
}
|
|
|
|
public async Task<game_city_npc_store> GetStoreInfo(string storeId)
|
|
{
|
|
var db = DbClient.AsTenant().GetConnectionWithAttr<game_city_npc_store>();
|
|
return await db.Queryable<game_city_npc_store>().Where(it => it.storeId == storeId).SingleAsync();
|
|
}
|
|
} |