This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user