Skip to content

Commit

Permalink
fix: fix channel search is not working with MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Jun 29, 2023
1 parent b1b3651 commit 0cea9e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func GetAllChannels(startIdx int, num int, selectAll bool) ([]*Channel, error) {
}

func SearchChannels(keyword string) (channels []*Channel, err error) {
err = DB.Omit("key").Where("id = ? or name LIKE ? or key = ?", keyword, keyword+"%", keyword).Find(&channels).Error
err = DB.Omit("key").Where("id = ? or name LIKE ? or `key` = ?", keyword, keyword+"%", keyword).Find(&channels).Error
return channels, err
}

Expand Down

0 comments on commit 0cea9e6

Please sign in to comment.