Commit 0e7f9f90 by mushishixian

解决冲突

parents 89ec071b a06f158d
;存放数据库连接信息
[xorm]
ShowSQL = false
[spu]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_spu
table_prefix =lie_
type = mysql
[liexin_data]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_data
table_prefix =lie_
type = mysql
#线上地址
#SupDbUser:Supssy2@@!!@$#yxy@172.18.137.21:3306/liexin_supp
[supp]
user_name = liexin_ass
password = `liexin_ass#zsyM`
host = 192.168.1.252
database = liexin_ass
table_prefix =lie_
type = mysql
[cms]
user_name = ichuntcms
password = `ichuntcms#zsyM`
host = 192.168.1.252
database = ichuntcms
table_prefix =
type = mysql
[sku0]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_0
table_prefix =lie_
type = mysql
[sku_0]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_0
table_prefix =lie_
type = mysql
[sku_1]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_1
table_prefix =lie_
type = mysql
[sku_2]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_2
table_prefix =lie_
type = mysql
[sku_3]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_3
table_prefix =lie_
type = mysql
[sku_4]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_4
table_prefix =lie_
type = mysql
[sku_5]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_5
table_prefix =lie_
type = mysql
[sku_6]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_6
table_prefix =lie_
type = mysql
[sku_7]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_7
table_prefix =lie_
type = mysql
[sku_8]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_8
table_prefix =lie_
type = mysql
[sku_9]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_9
table_prefix =lie_
type = mysql
;存放数据库连接信息
[xorm]
ShowSQL = false
[spu]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_spu
table_prefix =lie_
type = mysql
[liexin_data]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_data
table_prefix =lie_
type = mysql
#线上地址
#SupDbUser:Supssy2@@!!@$#yxy@172.18.137.21:3306/liexin_supp
[supp]
user_name = liexin_ass
password = `liexin_ass#zsyM`
host = 192.168.1.252
database = liexin_ass
table_prefix =lie_
type = mysql
[cms]
user_name = ichuntcms
password = `ichuntcms#zsyM`
host = 192.168.1.252
database = ichuntcms
table_prefix =
type = mysql
[sku0]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_0
table_prefix =lie_
type = mysql
[sku_0]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_0
table_prefix =lie_
type = mysql
[sku_1]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_1
table_prefix =lie_
type = mysql
[sku_2]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_2
table_prefix =lie_
type = mysql
[sku_3]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_3
table_prefix =lie_
type = mysql
[sku_4]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_4
table_prefix =lie_
type = mysql
[sku_5]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_5
table_prefix =lie_
type = mysql
[sku_6]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_6
table_prefix =lie_
type = mysql
[sku_7]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_7
table_prefix =lie_
type = mysql
[sku_8]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_8
table_prefix =lie_
type = mysql
[sku_9]
user_name = spu
password = spu
host = 192.168.1.234
database = liexin_sku_9
table_prefix =lie_
type = mysql
;redis连接信息
[default_redis_read]
host = 192.168.1.234:6379
password = icDb29mLy2s
max_idle = 2000
max_active = 5000
idle_timeout = 20
[default_redis_write]
host = 192.168.1.234:6379
password = icDb29mLy2s
max_idle = 2000
max_active = 5000
idle_timeout = 20
;存放redis所有键
;redis连接信息
[default_redis_read]
host = 192.168.1.234:6379
password = icDb29mLy2s
max_idle = 2000
max_active = 5000
idle_timeout = 20
[default_redis_write]
host = 192.168.1.234:6379
password = icDb29mLy2s
max_idle = 2000
max_active = 5000
idle_timeout = 20
;存放redis所有键
[redis_all]
\ No newline at end of file
......@@ -2,16 +2,17 @@ package service
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/gogf/gf/util/gconv"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"sort"
"sync"
"github.com/gin-gonic/gin"
"github.com/gogf/gf/util/gconv"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
)
type LyService struct {
......@@ -100,8 +101,6 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
}
}
//获取供应链标准品牌
//什么是供应链的标准品牌 供应链那边报关的时候要求他们的标准品牌,所以要吧自己的品牌映射上去
//继来那边对接的标准品牌(下单的时候)
......@@ -110,8 +109,8 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
//获取新版的标准品牌
sku.StandardBrand = ls.GetStandardBrand(brandId)
//处理过期
if gjson.Get(skuStr, "is_expire").Int() != 0 {
//处理过期,todo 2022.7.13 专卖没有过期
if sku.SupplierId != 17 && gjson.Get(skuStr, "is_expire").Int() != 0 {
sku.LadderPrice = nil
}
......@@ -161,13 +160,18 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
sku.LadderPriceResult = []int{}
}
//这边有个临时逻辑,如果供应商id是TI的,就库存为0
// if sku.SupplierId == 1679 {
// sku.Stock = 0
// }
//判断是否可以购买
sku.IsBuy = ls.GetIsBuy(sku)
////过期修改库存为0
//if sku.IsExpire == 1 {
// sku.Stock = 0
//}
//过期修改库存为0
if sku.IsExpire == 1 && sku.SupplierId != 17 {
sku.Stock = 0
}
var TagService TagsService
sku.GoodsTag = TagService.GetTags(sku.GoodsId, 0)
......
......@@ -2,17 +2,18 @@ package service
import (
"encoding/json"
"github.com/gomodule/redigo/redis"
_ "github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/pkg/common"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/logger"
_ "go_sku_server/pkg/mongo"
_ "gopkg.in/mgo.v2/bson"
"strings"
"github.com/gomodule/redigo/redis"
_ "github.com/iancoleman/orderedmap"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
_ "gopkg.in/mgo.v2/bson"
)
//获取图片信息
......@@ -40,8 +41,8 @@ func (ls *LyService) GetGoodsClass(sku model.LySku, spu string) model.LySku {
spuClassId1 := gjson.Get(spu, "class_id1").Int()
spuClassId2 := gjson.Get(spu, "class_id2").Int()
spuClassId3 := gjson.Get(spu, "class_id3").Int()
if spuClassId3 != 0 {
sku.ClassName = ls.GetCacheClass(spuClassId3)
if spuClassId2 != 0 {
sku.ClassName = ls.GetCacheClass(spuClassId2)
sku.ClassName3 = ls.GetCacheClass(spuClassId3)
sku.ClassName2 = ls.GetCacheClass(spuClassId2)
sku.ClassName1 = ls.GetCacheClass(spuClassId1)
......@@ -79,20 +80,21 @@ func (ls *LyService) GetPoolSupplierName(supplierId int64) (supplierName string)
func (ls *LyService) GetCacheClass(classId int64) string {
redisCon := gredis.Conn("default_r")
defer redisCon.Close()
className, _ := redis.String(redisCon.Do("HGET", "class", classId))
classStr, _ := redis.String(redisCon.Do("HGET", "pool_class_info", classId))
className := gjson.Get(classStr, "class_name").String()
return className
}
type SpuAttr struct {
SpuId string `bson:"spu_id"`
SpuId string `bson:"spu_id"`
AttrsExtend []AttrsExtend `bson:"attrs_extend"`
Attrs string `bson:"attrs"`
Attrs string `bson:"attrs"`
}
type AttrsExtend struct {
AttrName string `bson:"attr_name" json:"attr_name"`
AttrName string `bson:"attr_name" json:"attr_name"`
AttrValue string `bson:"attr_value" json:"attr_value"`
AttrUnit string `bson:"attr_unit" json:"attr_unit,omitempty"`
AttrUnit string `bson:"attr_unit" json:"attr_unit,omitempty"`
}
//H获取供应链标准品牌
......
......@@ -115,8 +115,8 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
standardBrand = ly.GetStandardBrand(brandId)
}
A.Set("brand_id", brandId)
A.Set("brand_name", brandName)
A.Set("brand_id_spu", brandId)
A.Set("brand_name_spu", brandName)
A.Set("standard_brand", standardBrand)
A.Set("class_id1", classId1) //
......@@ -170,9 +170,10 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
A.Set("cn_delivery_time", cnDeliveryTime) // 货期
//查询品牌名称(作废,现在改成读联营的品牌库,之前有关联自营商品到spu_id)
// brand_id := gjson.Get(info, "brand_id").Int()
// brand_info, _ := gredis.String(redisConn.Do("HGET", "Self_Brand", brand_id))
// A.Set("brand_name", gjson.Get(brand_info, "brand_name").String())
brand_id := gjson.Get(info, "brand_id").Int()
brand_info, _ := gredis.String(redisConn.Do("HGET", "Self_Brand", brand_id))
A.Set("brand_name", gjson.Get(brand_info, "brand_name").String())
A.Set("brand_id", brand_id)
if fast != "1" { //不是快速查询
// 供应商名称
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment