aa
This commit is contained in:
@@ -2144,6 +2144,26 @@ func GetVendorMatterRcmmd(ctx *jxcontext.Context, vendorID int, goodsID string,
|
|||||||
return handler.GetUnionMatterListRcmmd(ctx, goodsID, rcmmdType, offset, pageSize)
|
return handler.GetUnionMatterListRcmmd(ctx, goodsID, rcmmdType, offset, pageSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConfigUnion struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Data []*ConfigUnionData `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConfigUnionData struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
ID string `json:"id"`
|
||||||
|
Content *ConfigUnionDataContent `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ConfigUnionDataContent struct {
|
||||||
|
Imgsrc string `json:"imgSrc"`
|
||||||
|
Type int `json:"type"`
|
||||||
|
List []interface{} `json:"list"`
|
||||||
|
Bgcolor string `json:"bgColor"`
|
||||||
|
Ftcolor string `json:"ftColor"`
|
||||||
|
Topath int `json:"toPath"`
|
||||||
|
}
|
||||||
|
|
||||||
func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) {
|
func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
@@ -2181,7 +2201,6 @@ func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) {
|
|||||||
}
|
}
|
||||||
//建任务
|
//建任务
|
||||||
for _, v := range addList {
|
for _, v := range addList {
|
||||||
fmt.Println(utils.Format4Output(v, true))
|
|
||||||
//推广规则
|
//推广规则
|
||||||
storeURL := ""
|
storeURL := ""
|
||||||
percentage := 0
|
percentage := 0
|
||||||
@@ -2222,6 +2241,34 @@ func MtUnionJobAutoUpdate(ctx *jxcontext.Context) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
//更新banner
|
||||||
|
var (
|
||||||
|
configUnions []*ConfigUnion
|
||||||
|
configs []*model.NewConfig
|
||||||
|
)
|
||||||
|
if configs, _ = dao.QueryConfigs(db, "activeBanner", model.ConfigTypeSys, ""); len(configs) > 0 {
|
||||||
|
err = json.Unmarshal([]byte(configs[0].Value), &configUnions)
|
||||||
|
}
|
||||||
|
for _, config := range configUnions {
|
||||||
|
if config.Type == "美团外卖" {
|
||||||
|
config.Data = append(config.Data, &ConfigUnionData{
|
||||||
|
Title: "banner",
|
||||||
|
ID: utils.Int2Str(job.ID),
|
||||||
|
Content: &ConfigUnionDataContent{
|
||||||
|
Imgsrc: job.UnionImg,
|
||||||
|
Type: 1,
|
||||||
|
List: nil,
|
||||||
|
Bgcolor: "#ffffff",
|
||||||
|
Ftcolor: "#606266",
|
||||||
|
Topath: 10,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data, _ := json.Marshal(configUnions)
|
||||||
|
configs[0].Value = string(data)
|
||||||
|
dao.UpdateEntity(db, configs[0], "Value")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user