首页推荐商家
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/common"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/event"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/misc"
|
||||
"io"
|
||||
"math"
|
||||
"mime/multipart"
|
||||
@@ -137,6 +138,7 @@ type Info1 struct {
|
||||
BrandLogo string `json:"brandLogo"` //品牌logo
|
||||
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //订单满减金额
|
||||
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
||||
WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
||||
}
|
||||
|
||||
//首页展示信息
|
||||
@@ -155,6 +157,7 @@ type HomePageInfos struct {
|
||||
BrandLogo string `json:"brandLogo"` //品牌logo
|
||||
DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //订单满减金额
|
||||
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
||||
WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
||||
//Info *Info1 `json:"info"` //拼接数据
|
||||
//热销商品信息
|
||||
SkuID int `json:"skuID"` //商品ID
|
||||
@@ -5755,22 +5758,32 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
||||
if err != nil {
|
||||
return nil, "获取门店减免策略失败", err
|
||||
}
|
||||
tmp1 := Info1{
|
||||
StoreID: v.ID,
|
||||
StoreName: v.Name,
|
||||
OpenTime1: v.OpenTime1,
|
||||
CloseTime1: v.CloseTime1,
|
||||
OpenTime2: v.OpenTime2,
|
||||
CloseTime2: v.CloseTime2,
|
||||
Status: v.Status,
|
||||
Distance: v.Distance,
|
||||
Address: v.Address,
|
||||
BrandName: brandInfos.Name,
|
||||
BrandLogo: brandInfos.Logo,
|
||||
DeliveryFeeDeductionSill: storePolicy[0].DeliveryFeeDeductionSill,
|
||||
DeliveryFeeDeductionFee: storePolicy[0].DeliveryFeeDeductionFee,
|
||||
//获取店铺每周评分
|
||||
weeklyScore, err := misc.GetWeeklyStoreScore(v.ID, -1)
|
||||
if err != nil {
|
||||
return nil, "获取店铺每周评分失败", err
|
||||
}
|
||||
for _, k := range storePolicy {
|
||||
if k.StoreID == v.ID {
|
||||
tmp1 := Info1{
|
||||
StoreID: v.ID,
|
||||
StoreName: v.Name,
|
||||
OpenTime1: v.OpenTime1,
|
||||
CloseTime1: v.CloseTime1,
|
||||
OpenTime2: v.OpenTime2,
|
||||
CloseTime2: v.CloseTime2,
|
||||
Status: v.Status,
|
||||
Distance: v.Distance,
|
||||
Address: v.Address,
|
||||
BrandName: brandInfos.Name,
|
||||
BrandLogo: brandInfos.Logo,
|
||||
DeliveryFeeDeductionSill: storePolicy[0].DeliveryFeeDeductionSill,
|
||||
DeliveryFeeDeductionFee: storePolicy[0].DeliveryFeeDeductionFee,
|
||||
WeeklyScore: weeklyScore[0].TotalScore,
|
||||
}
|
||||
tmp1s = append(tmp1s, tmp1)
|
||||
}
|
||||
}
|
||||
tmp1s = append(tmp1s, tmp1)
|
||||
}
|
||||
//获取热销商品
|
||||
topSkusInfo, err := GetTopSkusByStoreIDs(ctx, storeID)
|
||||
@@ -5794,6 +5807,7 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
||||
BrandLogo: i.BrandLogo,
|
||||
DeliveryFeeDeductionSill: i.DeliveryFeeDeductionSill,
|
||||
DeliveryFeeDeductionFee: i.DeliveryFeeDeductionFee,
|
||||
WeeklyScore: i.WeeklyScore,
|
||||
SkuID: j.SkuID,
|
||||
SkuName: j.Name,
|
||||
SkuStatus: j.Status,
|
||||
|
||||
Reference in New Issue
Block a user