This commit is contained in:
邹宗楠
2024-10-09 17:42:53 +08:00
parent f5e1c062ff
commit 46e8b26ef8
3 changed files with 10 additions and 18 deletions

View File

@@ -6014,9 +6014,7 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
StoreSkuInfos []StoreSkuInfo
homePages []HomePageInfos
)
beginTime := time.Now()
locationList, err := common.GetStoreListByLocation(ctx, lng, lat, 20000, needWalkDistance, false, 0)
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------2:%d", time.Now().Sub(beginTime)/time.Millisecond)
if err != nil {
return nil, "经纬度获取推荐门店失败", err
}
@@ -6048,7 +6046,6 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
StoreSkuInfos = append(StoreSkuInfos, storeSkuInfo)
}
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------3:%d", time.Now().Sub(beginTime)/time.Millisecond)
for _, v := range filterStore {
//获取门店品牌信息
brandInfos, err := dao.GetStoreBrandInfos(v.ID)
@@ -6059,7 +6056,6 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
if scores, err := GetWeeklyStoreScore(v.ID, 0); err == nil && len(scores) > 0 {
storeScore = scores[0].TotalScore
}
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------3.5:%d,%s", time.Now().Sub(beginTime)/time.Millisecond, v.ID)
storeInfo := StoreInfo{
StoreID: v.ID,
@@ -6081,7 +6077,6 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
if err != nil {
return nil, "获取门店减免策略失败", err
}
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------3.6:%d", time.Now().Sub(beginTime)/time.Millisecond)
for _, k := range storePolicy {
if k.StoreID == v.ID {
storeDeductionInfo = StoreDeductionInfo{
@@ -6093,10 +6088,8 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
storeDeductionInfos = append(storeDeductionInfos, storeDeductionInfo)
}
//}
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------3.7:%d", time.Now().Sub(beginTime)/time.Millisecond)
}
baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------4:%d", time.Now().Sub(beginTime)/time.Millisecond)
for _, i := range storeInfos {
homePage := HomePageInfos{}