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