Skip to content

Commit e62c86a

Browse files
authored
[dish] fix: 关键词搜寻功能 (#904)
* [dish] 修复关键词搜寻功能 * [dish] 增加关键词未搜索到的提示
1 parent a9dfbdb commit e62c86a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugin/dish/dish.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ func init() {
7777
}
7878

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

@@ -86,7 +87,7 @@ func init() {
8687
"原材料:%s\n"+
8788
"步骤:\n"+
8889
"%s",
89-
name, dishName, d.Materials, d.Steps),
90+
name, d.Name, d.Materials, d.Steps),
9091
))
9192
})
9293

0 commit comments

Comments
 (0)