- 在 GetGatewayipOnlyIpByHostIdAll 方法中添加了 Model 指定 -确保查询正确关联到 Gatewayip 模型
@@ -128,5 +128,5 @@ func (r *gatewayipRepository) CleanIPByHostId(ctx context.Context, hostId []int6
func (r *gatewayipRepository) GetGatewayipOnlyIpByHostIdAll(ctx context.Context, hostId int64) ([]string, error) {
var req []string
- return req, r.DB(ctx).Where("host_id = ?", hostId).Pluck("ip", &req).Error
+ return req, r.DB(ctx).Model(&model.Gatewayip{}).Where("host_id = ?", hostId).Pluck("ip", &req).Error
}