This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user