Lookup now will ignore case to find sticker

This commit is contained in:
LittleSheep 2024-09-16 20:40:57 +08:00
parent 241d61758a
commit 778d09d74a

View File

@ -13,7 +13,7 @@ func GetStickerWithAlias(alias string) (models.Sticker, error) {
prefix := viper.GetString("database.prefix")
if err := database.C.
Joins(fmt.Sprintf("LEFT JOIN %ssticker_packs pk ON pack_id = pk.id", prefix)).
Where("CONCAT(pk.prefix, alias) = ?", alias).
Where("UPPER(CONCAT(pk.prefix, alias)) = UPPER(?)", alias).
Preload("Attachment").Preload("Pack").
First(&sticker).Error; err != nil {
return sticker, err