From 348cb4e6703019f37cea51ff84e5a46b4d7e9e91 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 7 May 2026 18:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=91=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/service/client_auth/service.go | 4 +++- internal/store/postgres/personal_customer_phone_store.go | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/service/client_auth/service.go b/internal/service/client_auth/service.go index 4706565..d1d9d1f 100644 --- a/internal/service/client_auth/service.go +++ b/internal/service/client_auth/service.go @@ -309,10 +309,12 @@ func (s *Service) BindPhone(ctx context.Context, customerID uint, req *dto.BindP return nil, errors.Wrap(errors.CodeInternalError, err, "查询手机号绑定关系失败") } + now := time.Now() record := &model.PersonalCustomerPhone{ CustomerID: customerID, Phone: req.Phone, IsPrimary: true, + VerifiedAt: &now, Status: 1, } if err := s.phoneStore.Create(ctx, record); err != nil { @@ -321,7 +323,7 @@ func (s *Service) BindPhone(ctx context.Context, customerID uint, req *dto.BindP return &dto.BindPhoneResponse{ Phone: req.Phone, - BoundAt: record.VerifiedAt.Format("2006-01-02 15:04:05"), + BoundAt: now.Format("2006-01-02 15:04:05"), }, nil } diff --git a/internal/store/postgres/personal_customer_phone_store.go b/internal/store/postgres/personal_customer_phone_store.go index 2ee65b6..05acf25 100644 --- a/internal/store/postgres/personal_customer_phone_store.go +++ b/internal/store/postgres/personal_customer_phone_store.go @@ -21,7 +21,6 @@ func NewPersonalCustomerPhoneStore(db *gorm.DB) *PersonalCustomerPhoneStore { // Create 创建手机号绑定记录 func (s *PersonalCustomerPhoneStore) Create(ctx context.Context, phone *model.PersonalCustomerPhone) error { - // VerifiedAt 在验证通过后更新,创建时保持 nil return s.db.WithContext(ctx).Create(phone).Error }