update
This commit is contained in:
parent
1a9bca31ba
commit
5363acefd9
|
|
@ -145,15 +145,16 @@ func DataInit() {
|
|||
//--------------------------------------------------宠物商品关联数据---------------------------------------------------------
|
||||
var petGoodsList []models.PetGoods
|
||||
database.Instance().Model(&models.PetGoods{}).Find(&petGoodsList)
|
||||
PetGoodsMap = make(map[string][]models.PetGoods)
|
||||
var PetGoodsMapC1 = make(map[string][]models.PetGoods)
|
||||
for _, value := range petGoodsList {
|
||||
key := strconv.Itoa(value.Assortment) + strconv.Itoa(value.PetType) + strconv.Itoa(value.Weight) + strconv.Itoa(value.Hair)
|
||||
if _, ok := PetGoodsMap[key]; ok {
|
||||
PetGoodsMap[key] = append(PetGoodsMap[key], value)
|
||||
if _, ok := PetGoodsMapC1[key]; ok {
|
||||
PetGoodsMapC1[key] = append(PetGoodsMapC1[key], value)
|
||||
} else {
|
||||
PetGoodsMap[key] = []models.PetGoods{value}
|
||||
PetGoodsMapC1[key] = []models.PetGoods{value}
|
||||
}
|
||||
}
|
||||
PetGoodsMap = PetGoodsMapC1
|
||||
zap_server.ZAPLOG.Info("dataInit petGoodsMap : ", zap.Any("petGoodsMap", PetGoodsMap))
|
||||
var goodsList []models.Goods
|
||||
database.Instance().Model(&models.Goods{}).Find(&goodsList)
|
||||
|
|
|
|||
Loading…
Reference in New Issue