Skip to content

Commit

Permalink
[dish] fix: 关键词搜寻功能 (#904)
Browse files Browse the repository at this point in the history
* [dish] 修复关键词搜寻功能

* [dish] 增加关键词未搜索到的提示
  • Loading branch information
Kittengarten committed May 11, 2024
1 parent a9dfbdb commit e62c86a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/dish/dish.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ func init() {
}

var d dish
if err := db.Find("dish", &d, fmt.Sprintf("WHERE name like %%%s%%", dishName)); err != nil {
if err := db.Find("dish", &d, fmt.Sprintf("WHERE name like '%%%s%%'", dishName)); err != nil {
ctx.SendChain(message.Text("客官,本店没有" + dishName))
return
}

Expand All @@ -86,7 +87,7 @@ func init() {
"原材料:%s\n"+
"步骤:\n"+
"%s",
name, dishName, d.Materials, d.Steps),
name, d.Name, d.Materials, d.Steps),
))
})

Expand Down

0 comments on commit e62c86a

Please sign in to comment.