From e62c86a7409fc68f7e930ed8af3f9249bf57044f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E9=9F=B3=E5=B9=BB=E7=A6=BB?= Date: Sat, 11 May 2024 23:00:19 +0800 Subject: [PATCH] =?UTF-8?q?[dish]=20fix:=20=E5=85=B3=E9=94=AE=E8=AF=8D?= =?UTF-8?q?=E6=90=9C=E5=AF=BB=E5=8A=9F=E8=83=BD=20(#904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [dish] 修复关键词搜寻功能 * [dish] 增加关键词未搜索到的提示 --- plugin/dish/dish.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/dish/dish.go b/plugin/dish/dish.go index 5edf79403b..6fd9985837 100644 --- a/plugin/dish/dish.go +++ b/plugin/dish/dish.go @@ -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 } @@ -86,7 +87,7 @@ func init() { "原材料:%s\n"+ "步骤:\n"+ "%s", - name, dishName, d.Materials, d.Steps), + name, d.Name, d.Materials, d.Steps), )) })