From fe577052868fb56a00bbe7e746aeecd5797a203a Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 27 Sep 2023 12:23:02 +0800 Subject: [PATCH] info get profile --- model/gmodel/fs_address_logic.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/model/gmodel/fs_address_logic.go b/model/gmodel/fs_address_logic.go index 7230f658..22498d89 100755 --- a/model/gmodel/fs_address_logic.go +++ b/model/gmodel/fs_address_logic.go @@ -2,7 +2,6 @@ package gmodel import ( "context" - "fmt" "time" "github.com/zeromicro/go-zero/core/logx" @@ -101,7 +100,7 @@ func (a *FsAddressModel) SettingUserDefaultAddress(ctx context.Context, userId i return err } - err = tx.Where(fmt.Sprintf("`user_id` = ? and `status` = 1 and `address_id` != ? and `ltime` > '%s'", now.AddDate(10, 0, 0)), userId, addressId).Take(nil).Error + err = tx.Model(&FsAddress{}).Where("`user_id` = ? and `status` = 1 and `address_id` != ? and ltime > ?", userId, addressId, now.AddDate(10, 0, 0)).Take(nil).Error if err != nil { logx.Error(err) }