Merge branch 'jdshop' of e.coding.net:rosydev/jx-callback into jdshop
This commit is contained in:
@@ -159,9 +159,9 @@ type StoreSkuInfo struct {
|
||||
|
||||
//首页展示信息
|
||||
type HomePageInfos struct {
|
||||
StoreInfo StoreInfo `json:"storeInfo"`
|
||||
StoreDeductionInfo StoreDeductionInfo `json:"StoreDeductionInfo"`
|
||||
StoreSkuInfo StoreSkuInfo `json:"StoreSkuInfo"`
|
||||
StoreInfo StoreInfo `json:"storeInfo"`
|
||||
StoreDeductionInfo []StoreDeductionInfo `json:"StoreDeductionInfo"`
|
||||
StoreSkuInfo []StoreSkuInfo `json:"StoreSkuInfo"`
|
||||
}
|
||||
|
||||
type JdStoreLevelExt struct {
|
||||
@@ -5732,7 +5732,6 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
||||
storeDeductionInfos []StoreDeductionInfo
|
||||
storeSkuInfo StoreSkuInfo
|
||||
StoreSkuInfos []StoreSkuInfo
|
||||
homePage HomePageInfos
|
||||
homePages []HomePageInfos
|
||||
)
|
||||
locationList, err := common.GetStoreListByLocation(ctx, lng, lat, 20000, needWalkDistance, false, 0)
|
||||
@@ -5782,11 +5781,8 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
||||
storeDeductionInfos = append(storeDeductionInfos, storeDeductionInfo)
|
||||
}
|
||||
}
|
||||
globals.SugarLogger.Debug("storeInfos============", storeInfos)
|
||||
globals.SugarLogger.Debug("storeDeductionInfos=================", storeDeductionInfos)
|
||||
//获取热销商品
|
||||
topSkusInfo, err := GetTopSkusByStoreIDs(ctx, storeID)
|
||||
globals.SugarLogger.Debug("topSkusInfo==============", topSkusInfo)
|
||||
if err != nil {
|
||||
return nil, "获取热销商品失败", err
|
||||
}
|
||||
@@ -5803,22 +5799,28 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
||||
}
|
||||
StoreSkuInfos = append(StoreSkuInfos, storeSkuInfo)
|
||||
}
|
||||
globals.SugarLogger.Debug("StoreSkuInfos=================", StoreSkuInfos)
|
||||
for _, i := range storeInfos {
|
||||
homePage := HomePageInfos{}
|
||||
i := i
|
||||
homePage.StoreInfo = i
|
||||
for _, j := range storeDeductionInfos {
|
||||
for _, k := range StoreSkuInfos {
|
||||
if i.StoreID == j.StoreID && i.StoreID == k.StoreID {
|
||||
homePage = HomePageInfos{
|
||||
StoreInfo: i,
|
||||
StoreDeductionInfo: j,
|
||||
StoreSkuInfo: k,
|
||||
}
|
||||
}
|
||||
j := j
|
||||
if i.StoreID == j.StoreID {
|
||||
homePage.StoreDeductionInfo = append(homePage.StoreDeductionInfo, j)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
for _, k := range StoreSkuInfos {
|
||||
k := k
|
||||
if i.StoreID == k.StoreID {
|
||||
homePage.StoreSkuInfo = append(homePage.StoreSkuInfo, k)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
}
|
||||
homePages = append(homePages, homePage)
|
||||
}
|
||||
globals.SugarLogger.Debug("homePages====================", homePages)
|
||||
}
|
||||
return homePages, "", nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user