From 5ae442993ede66db1abf6d26922af89bee4315c9 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 10 Aug 2021 16:58:41 +0800 Subject: [PATCH] aa --- business/jxstore/cms/job.go | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index f9b10a3ed..19af3f7f5 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -954,6 +954,35 @@ func RefreshJobStatus(ctx *jxcontext.Context) (err error) { } } 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...") @@ -2269,7 +2298,6 @@ func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) { data, _ := json.Marshal(configUnions) configs[0].Value = string(data) dao.UpdateEntity(db, configs[0], "Value") - break } return err }