Commit 0e7f9f90 by mushishixian

解决冲突

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