aa
This commit is contained in:
@@ -954,6 +954,35 @@ func RefreshJobStatus(ctx *jxcontext.Context) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Commit(db, txDB)
|
dao.Commit(db, txDB)
|
||||||
|
//美团的先删了
|
||||||
|
if job2.JobCategoryID == model.JobCategoryIDUnion && job2.VendorID == model.VendorIDMTWM {
|
||||||
|
var (
|
||||||
|
configs []*model.NewConfig
|
||||||
|
configUnions []ConfigUnion
|
||||||
|
index1, index2 int
|
||||||
|
)
|
||||||
|
if configs, _ = dao.QueryConfigs(db, "activeBanner", model.ConfigTypeSys, ""); len(configs) > 0 {
|
||||||
|
err = json.Unmarshal([]byte(configs[0].Value), &configUnions)
|
||||||
|
}
|
||||||
|
for k1, config := range configUnions {
|
||||||
|
if config.Type == "美团外卖" {
|
||||||
|
index1 = k1
|
||||||
|
for k2, v := range config.Data {
|
||||||
|
if v.ID == utils.Int2Str(job2.ID) {
|
||||||
|
index2 = k2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var list []*ConfigUnionData
|
||||||
|
list = append(list, configUnions[index1].Data[:index2]...)
|
||||||
|
list = append(list, configUnions[index1].Data[index2+1:]...)
|
||||||
|
configUnions[index1].Data = list
|
||||||
|
data, _ := json.Marshal(configUnions)
|
||||||
|
configs[0].Value = string(data)
|
||||||
|
dao.UpdateEntity(db, configs[0], "Value")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("RefreshJobStatus end...")
|
globals.SugarLogger.Debugf("RefreshJobStatus end...")
|
||||||
@@ -2269,7 +2298,6 @@ func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) {
|
|||||||
data, _ := json.Marshal(configUnions)
|
data, _ := json.Marshal(configUnions)
|
||||||
configs[0].Value = string(data)
|
configs[0].Value = string(data)
|
||||||
dao.UpdateEntity(db, configs[0], "Value")
|
dao.UpdateEntity(db, configs[0], "Value")
|
||||||
break
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user