From c4affb238c4b3c2ff5acb378435de6f46429fed4 Mon Sep 17 00:00:00 2001 From: lzh <1625167628@qq.com> Date: Thu, 16 Oct 2025 09:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=BF=80=E6=B4=BB=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/dao/bundleExtend.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/dao/bundleExtend.go b/internal/dao/bundleExtend.go index 6e715d2..e31b721 100644 --- a/internal/dao/bundleExtend.go +++ b/internal/dao/bundleExtend.go @@ -480,9 +480,9 @@ func BundleActivate(ids []uint32) error { app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error { activate := model.BundleActivate{} if err := tx.Model(&model.BundleActivate{}).Where("user_id = ?", v).First(&activate).Error; err != nil { - return err + return tx.Model(&model.BundleActivate{}).Where("user_id = ?", v).Create(&model.BundleActivate{UserId: int(v), Activate: 2}).Error } - if activate.Activate == 2 { // 第一次激活重新计算余量的开始时间和过期时间 + if activate.Activate != 2 { // 第一次激活重新计算余量的开始时间和过期时间 balance := model.BundleBalance{} if err := tx.Model(&model.BundleBalance{}).Where("user_id = ?", v).First(&balance).Error; err != nil { return err