新增字段
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m7s

This commit is contained in:
2026-05-12 14:10:48 +08:00
parent 8f3a68a673
commit a5388446d3
13 changed files with 278 additions and 182 deletions

View File

@@ -604,23 +604,8 @@ func (s *ActivationService) syncCarrierStatusActivated(ctx context.Context, tx *
}
if usage.UsageType == constants.PackageUsageTypeDevice || usage.DeviceID > 0 || carrierType == constants.AssetTypeDevice {
deviceID := usage.DeviceID
if deviceID == 0 {
deviceID = carrierID
}
if deviceID == 0 {
return
}
if err := tx.WithContext(ctx).
Model(&model.Device{}).
Where("id = ? AND status < ?", deviceID, constants.DeviceStatusActivated).
Update("status", constants.DeviceStatusActivated).Error; err != nil {
s.logger.Warn("套餐激活后更新设备状态失败",
zap.Uint("device_id", deviceID),
zap.Uint("usage_id", usage.ID),
zap.Error(err))
}
// 设备激活状态由“生效中主套餐 + 任意绑定卡已实名”动态计算,
// 不再写入设备归属状态字段。
return
}