Compare commits
1 Commits
7dae5f2bf8
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1efb665619 |
@@ -552,8 +552,12 @@ func (s *ActivationService) isCarrierRealnamed(ctx context.Context, tx *gorm.DB,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *ActivationService) activatePendingUsage(ctx context.Context, tx *gorm.DB, usage *model.PackageUsage, pkg *model.Package, carrierType string, carrierID uint, now time.Time, logMessage string) error {
|
func (s *ActivationService) activatePendingUsage(ctx context.Context, tx *gorm.DB, usage *model.PackageUsage, pkg *model.Package, carrierType string, carrierID uint, now time.Time, logMessage string) error {
|
||||||
|
// ExpiryBase=from_purchase 只用于"等待实名激活"场景(REALNAME-04):套餐已购买但资产未实名,
|
||||||
|
// 计时基准按购买时间算,实名只是解锁使用权。此函数同时被"前一个主套餐到期后排队顺延"场景复用,
|
||||||
|
// 这种情况下 usage.PendingRealnameActivation 为 false,不应该套用购买时间,否则排队等待的天数会
|
||||||
|
// 从到期时间里被扣掉。只有当这条记录确实是因为等实名才被搁置时,才按 ExpiryBase 选基准。
|
||||||
var activatedAt time.Time
|
var activatedAt time.Time
|
||||||
if pkg.ExpiryBase == "from_purchase" {
|
if usage.PendingRealnameActivation && pkg.ExpiryBase == "from_purchase" {
|
||||||
activatedAt = usage.CreatedAt
|
activatedAt = usage.CreatedAt
|
||||||
} else {
|
} else {
|
||||||
activatedAt = now
|
activatedAt = now
|
||||||
|
|||||||
Reference in New Issue
Block a user