StoreExt的StoreMaps与CourierMaps从map数组改为struct数组

This commit is contained in:
gazebo
2019-12-11 16:04:44 +08:00
parent 95a669476e
commit ef5ec63951
4 changed files with 33 additions and 32 deletions

View File

@@ -55,15 +55,17 @@ type StoreExt struct {
FloatLng float64 `json:"lng"`
FloatLat float64 `json:"lat"`
ProvinceCode int `json:"provinceCode"`
ProvinceName string `json:"provinceName"`
CityName string `json:"cityName"`
DistrictName string `json:"districtName"`
StoreMapStr string `json:"-"`
CourierMapStr string `json:"-"`
PayeeBankName string `json:"payeeBankName"` // 开户行名称
StoreMaps []map[string]interface{} `orm:"-"`
CourierMaps []map[string]interface{} `orm:"-"`
ProvinceCode int `json:"provinceCode"`
ProvinceName string `json:"provinceName"`
CityName string `json:"cityName"`
DistrictName string `json:"districtName"`
StoreMapStr string `json:"-"`
CourierMapStr string `json:"-"`
PayeeBankName string `json:"payeeBankName"` // 开户行名称
// StoreMaps []map[string]interface{} `orm:"-"`
// CourierMaps []map[string]interface{} `orm:"-"`
StoreMaps []*model.StoreMap `json:"StoreMaps"`
CourierMaps []*model.StoreCourierMap `json:"CourierMaps"`
OrderCount int `json:"orderCount"`
}
@@ -404,10 +406,10 @@ func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresIn
v.Licence2Image = ""
}
for _, v2 := range storeMapMap[v.ID] {
v.StoreMaps = append(v.StoreMaps, utils.Struct2FlatMap(v2))
v.StoreMaps = append(v.StoreMaps, v2)
}
for _, v2 := range storeCourierMap[v.ID] {
v.CourierMaps = append(v.CourierMaps, utils.Struct2FlatMap(v2))
v.CourierMaps = append(v.CourierMaps, v2)
}
}
return nil