From 8b7487b42b81e4f1b0c8bf7097e69d44eb4d48d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Thu, 7 Dec 2023 23:00:57 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/sys_message.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/handler/sys_message.go b/handler/sys_message.go index d963bcdd..7b0ea09c 100644 --- a/handler/sys_message.go +++ b/handler/sys_message.go @@ -6,7 +6,6 @@ import ( "go-wechat/entity" "go-wechat/model" "go-wechat/utils" - "log" ) // handleNewUserJoin @@ -15,12 +14,8 @@ import ( func handleNewUserJoin(m model.Message) { // 判断是否开启迎新 var count int64 - err := client.MySQL.Model(&entity.Friend{}). - Where("enable_welcome IS TRUE"). - Where("wxid = ?", m.FromUser). - Count(&count).Error - if err != nil { - log.Printf("查询是否开启迎新失败: %s", err.Error()) + client.MySQL.Model(&entity.Friend{}).Where("enable_welcome IS TRUE").Where("wxid = ?", m.FromUser).Count(&count) + if count < 1 { return } if count < 1 {