From e09c58042d5aa7ac64ddd5d7abfd8e450d764d18 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Tue, 10 Dec 2024 18:07:40 +0800 Subject: [PATCH] update --- src/implement/user_tag_records_implement.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/implement/user_tag_records_implement.go b/src/implement/user_tag_records_implement.go index 8e956d5..25fb964 100644 --- a/src/implement/user_tag_records_implement.go +++ b/src/implement/user_tag_records_implement.go @@ -79,7 +79,11 @@ func (u UserTagRecordsDb) UserTagRecordsFindByParams(params map[string]interface func (u UserTagRecordsDb) UserTagRecordsExist(uid int64, tagId int) (bool, error) { var m model.UserTagRecords - exist, err := u.Db.Where("uid = ?", uid).And("tag_id = ?", tagId).Exist(m) + session := u.Db.Where("tag_id = ?", tagId) + if uid != 0 { + session.And("uid=?", uid) + } + exist, err := session.Exist(m) if err != nil { return false, zhios_order_relate_logx.Error(err) }