home
This commit is contained in:
@@ -139,6 +139,15 @@ type Info1 struct {
|
|||||||
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
||||||
WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
||||||
}
|
}
|
||||||
|
type Info2 struct {
|
||||||
|
SkuID int `json:"skuID"` //商品ID
|
||||||
|
SkuName string `json:"skuName"` //商品名字
|
||||||
|
SkuStatus int `json:"skuStatus"` //商品是否可售状态 1可售 0不可售
|
||||||
|
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||||
|
Img string `json:"img"` //商品第一张图片
|
||||||
|
Price int `json:"price"` // 单位为分,标准价,不为份的就为实际标准价,为份的为每市斤价,实际还要乘质量
|
||||||
|
Unit string `json:"unit"` //商品售卖单位 份/kg等
|
||||||
|
}
|
||||||
|
|
||||||
//首页展示信息
|
//首页展示信息
|
||||||
type HomePageInfos struct {
|
type HomePageInfos struct {
|
||||||
@@ -157,15 +166,16 @@ type HomePageInfos struct {
|
|||||||
//DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //订单满减金额
|
//DeliveryFeeDeductionSill int `json:"deliveryFeeDeductionSill"` //订单满减金额
|
||||||
//DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
//DeliveryFeeDeductionFee int `json:"deliveryFeeDeductionFee"` //订单减免金额
|
||||||
//WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
//WeeklyScore int `json:"weeklyScore"` //店铺每周评分
|
||||||
Info Info1 `json:"info"` //拼接数据
|
Info Info1 `json:"info1"` //拼接数据
|
||||||
//热销商品信息
|
//热销商品信息
|
||||||
SkuID int `json:"skuID"` //商品ID
|
Info2 Info2 `json:"info2"`
|
||||||
SkuName string `json:"skuName"` //商品名字
|
//SkuID int `json:"skuID"` //商品ID
|
||||||
SkuStatus int `json:"skuStatus"` //商品是否可售状态 1可售 0不可售
|
//SkuName string `json:"skuName"` //商品名字
|
||||||
BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
//SkuStatus int `json:"skuStatus"` //商品是否可售状态 1可售 0不可售
|
||||||
Img string `json:"img"` //商品第一张图片
|
//BestSeller int `json:"bestSeller"` //畅销品 0不是 1是
|
||||||
Price int `json:"price"` // 单位为分,标准价,不为份的就为实际标准价,为份的为每市斤价,实际还要乘质量
|
//Img string `json:"img"` //商品第一张图片
|
||||||
Unit string `json:"unit"` //商品售卖单位 份/kg等
|
//Price int `json:"price"` // 单位为分,标准价,不为份的就为实际标准价,为份的为每市斤价,实际还要乘质量
|
||||||
|
//Unit string `json:"unit"` //商品售卖单位 份/kg等
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5733,7 +5743,9 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
|||||||
var (
|
var (
|
||||||
storeID []int
|
storeID []int
|
||||||
tmp1s []Info1
|
tmp1s []Info1
|
||||||
multipleData []HomePageInfos
|
multipleData []Info2
|
||||||
|
data Info2
|
||||||
|
res []HomePageInfos
|
||||||
)
|
)
|
||||||
locationList, err := common.GetStoreListByLocation(ctx, lng, lat, 20000, needWalkDistance, false, 0)
|
locationList, err := common.GetStoreListByLocation(ctx, lng, lat, 20000, needWalkDistance, false, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -5778,7 +5790,6 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
|||||||
BrandLogo: brandInfos.Logo,
|
BrandLogo: brandInfos.Logo,
|
||||||
DeliveryFeeDeductionSill: storePolicy[0].DeliveryFeeDeductionSill,
|
DeliveryFeeDeductionSill: storePolicy[0].DeliveryFeeDeductionSill,
|
||||||
DeliveryFeeDeductionFee: storePolicy[0].DeliveryFeeDeductionFee,
|
DeliveryFeeDeductionFee: storePolicy[0].DeliveryFeeDeductionFee,
|
||||||
//WeeklyScore: weeklyScore[0].TotalScore,
|
|
||||||
}
|
}
|
||||||
tmp1s = append(tmp1s, tmp1)
|
tmp1s = append(tmp1s, tmp1)
|
||||||
}
|
}
|
||||||
@@ -5792,22 +5803,7 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
|||||||
for _, i := range tmp1s {
|
for _, i := range tmp1s {
|
||||||
for _, j := range topSkusInfo {
|
for _, j := range topSkusInfo {
|
||||||
if i.StoreID == j.StoreID {
|
if i.StoreID == j.StoreID {
|
||||||
data := HomePageInfos{
|
data = Info2{
|
||||||
//StoreID: i.StoreID,
|
|
||||||
//StoreName: i.StoreName,
|
|
||||||
//OpenTime1: i.OpenTime1,
|
|
||||||
//CloseTime1: i.CloseTime1,
|
|
||||||
//OpenTime2: i.OpenTime2,
|
|
||||||
//CloseTime2: i.CloseTime2,
|
|
||||||
//Status: i.Status,
|
|
||||||
//Distance: i.Distance,
|
|
||||||
//Address: i.Address,
|
|
||||||
//BrandName: i.BrandName,
|
|
||||||
//BrandLogo: i.BrandLogo,
|
|
||||||
//DeliveryFeeDeductionSill: i.DeliveryFeeDeductionSill,
|
|
||||||
//DeliveryFeeDeductionFee: i.DeliveryFeeDeductionFee,
|
|
||||||
//WeeklyScore: i.WeeklyScore,
|
|
||||||
Info: i,
|
|
||||||
SkuID: j.SkuID,
|
SkuID: j.SkuID,
|
||||||
SkuName: j.Name,
|
SkuName: j.Name,
|
||||||
SkuStatus: j.Status,
|
SkuStatus: j.Status,
|
||||||
@@ -5818,8 +5814,13 @@ func GetHomePageByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDis
|
|||||||
}
|
}
|
||||||
multipleData = append(multipleData, data)
|
multipleData = append(multipleData, data)
|
||||||
}
|
}
|
||||||
|
ans := HomePageInfos{
|
||||||
|
Info: i,
|
||||||
|
Info2: data,
|
||||||
|
}
|
||||||
|
res = append(res, ans)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return multipleData, "", nil
|
return res, "", nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user