Compare commits
No commits in common. "d58f0e574a53ff322dba5c1ff5d2581ff98af8f0" and "34f22255680f81aa6c33529794688ea687797d3a" have entirely different histories.
d58f0e574a
...
34f2225568
@ -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 tx.Model(&model.BundleActivate{}).Where("user_id = ?", v).Create(&model.BundleActivate{UserId: int(v), Activate: 2}).Error
|
||||
return err
|
||||
}
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user