update
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user