feat(fight): 使用专用函数构建战斗结束数据包 为战斗结束消息创建专用的构建函数, 统一处理战斗结束信息的数据包构建逻辑, 提高代码的一致性和可维护性。 fix(config): 优化数据库查询语句以提高性能 将数组包含操作(@>)替换为 ANY 操作符, 在 Egg、MapPit、PetFusion 等服务中使用更高效 的查询方式
This commit is contained in:
@@ -51,7 +51,7 @@ func (s *PetFusionService) Data(p1, p2, rand uint32) uint32 {
|
||||
func (s *PetFusionService) getData(p1, p2 uint32) uint32 {
|
||||
|
||||
var pet []model.PetFusion //一个特性应该是唯一的,但是我们要获取默认随机特性
|
||||
dbm_enable(s.Model).Where("main_pet_id", p1).Wheref(`sub_pet_ids @> ARRAY[?]::integer[]`, p2).Scan(&pet)
|
||||
dbm_enable(s.Model).Where("main_pet_id", p1).Wheref(`? = ANY(sub_pet_ids)`, p2).Scan(&pet)
|
||||
if len(pet) != 0 {
|
||||
var pets, props []int
|
||||
|
||||
|
||||
Reference in New Issue
Block a user