fix(subscribe): improve query logic and handle status filtering
This commit is contained in:
@@ -369,15 +369,14 @@ func (l *ActivateOrderLogic) Renewal(ctx context.Context, orderInfo *order.Order
|
||||
userSub.Status = 1
|
||||
}
|
||||
|
||||
//fix bug:FinishedAt causes the update subscription to fail
|
||||
if now.AddDate(-30, 0, 0).After(*userSub.FinishedAt) {
|
||||
userSub.FinishedAt = &now
|
||||
}
|
||||
// Check whether traffic reset on renewal is enabled
|
||||
if !*sub.RenewalReset {
|
||||
userSub.Download = 0
|
||||
userSub.Upload = 0
|
||||
}
|
||||
if userSub.FinishedAt != nil {
|
||||
userSub.FinishedAt = nil
|
||||
}
|
||||
|
||||
userSub.ExpireTime = tool.AddTime(sub.UnitTime, orderInfo.Quantity, userSub.ExpireTime)
|
||||
// update user subscribe
|
||||
|
||||
Reference in New Issue
Block a user