This commit is contained in:
@@ -48,8 +48,7 @@ func (s *ShinyService) RandShiny(id uint32) *model.ColorfulSkin {
|
||||
// 执行 Raw SQL 并扫描返回值
|
||||
dbm(s.Model).
|
||||
Wheref(`bind_elf_ids @> ?::jsonb`, id).
|
||||
Wheref(`jsonb_typeof(bind_elf_ids) = ?`, "array").
|
||||
Where("is_enabled", 1).Scan(&ret)
|
||||
Wheref(`jsonb_typeof(bind_elf_ids) = ?`, "array").Scan(&ret)
|
||||
|
||||
for _, v := range ret {
|
||||
//print(v.ID)
|
||||
@@ -76,8 +75,7 @@ func (s *ShinyService) FixShiny(id uint32) *model.ColorfulSkin {
|
||||
// 执行 Raw SQL 并扫描返回值
|
||||
dbm(s.Model).
|
||||
Wheref(`bind_elf_ids @> ?::jsonb`, id).
|
||||
Wheref(`jsonb_typeof(bind_elf_ids) = ?`, "array").
|
||||
Where("is_enabled", 1).Scan(&ret)
|
||||
Wheref(`jsonb_typeof(bind_elf_ids) = ?`, "array").Scan(&ret)
|
||||
if len(ret) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user