Commit 2e918fed by mushishixian

Merge branch 'master' into dev

parents 4863368e bcd4ffc0
......@@ -5,7 +5,7 @@ ShowSQL = false
[spu]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_spu
table_prefix =lie_
type = mysql
......@@ -13,7 +13,7 @@ type = mysql
[liexin_data]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_data
table_prefix =lie_
type = mysql
......@@ -39,7 +39,7 @@ type = mysql
[sku0]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_0
table_prefix =lie_
type = mysql
......@@ -47,7 +47,7 @@ type = mysql
[sku_0]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_0
table_prefix =lie_
type = mysql
......@@ -55,7 +55,7 @@ type = mysql
[sku_1]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_1
table_prefix =lie_
type = mysql
......@@ -63,7 +63,7 @@ type = mysql
[sku_2]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_2
table_prefix =lie_
type = mysql
......@@ -71,7 +71,7 @@ type = mysql
[sku_3]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_3
table_prefix =lie_
type = mysql
......@@ -79,7 +79,7 @@ type = mysql
[sku_4]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_4
table_prefix =lie_
type = mysql
......@@ -87,7 +87,7 @@ type = mysql
[sku_5]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_5
table_prefix =lie_
type = mysql
......@@ -95,7 +95,7 @@ type = mysql
[sku_6]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_6
table_prefix =lie_
type = mysql
......@@ -103,7 +103,7 @@ type = mysql
[sku_7]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_7
table_prefix =lie_
type = mysql
......@@ -111,7 +111,7 @@ type = mysql
[sku_8]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_8
table_prefix =lie_
type = mysql
......@@ -119,7 +119,7 @@ type = mysql
[sku_9]
user_name = spu
password = spu
host = 192.168.1.234
host = 192.168.1.238
database = liexin_sku_9
table_prefix =lie_
type = mysql
......
package model
import (
"strings"
"github.com/tidwall/gjson"
)
......@@ -166,6 +168,7 @@ func InitSkuData(sku string) (data LySku) {
data.GoodsDetails = goodsDetail
goodsImages := gjson.Get(sku, "goods_images").String()
goodsImages = strings.Replace(goodsImages, "http://img.ichunt.com", "https://img.ichunt.com", 1)
data.GoodsImages = goodsImages
canal := gjson.Get(sku, "canal").String()
......
......@@ -5,12 +5,12 @@ import (
"go_sku_server/pkg/gredis"
"go_sku_server/service/sorter"
"sort"
"strings"
"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"
)
......@@ -65,10 +65,13 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
sku = ls.GetGoodsImages(sku, spu)
//pdf
pdf := gjson.Get(spu, "pdf").String()
spuLargeImage := gjson.Get(spu, "images_l").String()
if pdf == "" || (php2go.Strlen(spuLargeImage) < 5) {
sku.Pdf = ""
} else {
// spuLargeImage := gjson.Get(spu, "images_l").String()
if pdf != "" {
pdf = strings.Replace(pdf, "http://img.ichunt.com", "https://img.ichunt.com", 1)
//还要针对如果是自己的上传服务的pdf文件,还要补上类型用于预览
if (strings.Contains(pdf, "files.ichunt.net") || strings.Contains(pdf, "file.liexindev.net")) && !strings.Contains(pdf, "fileType=pdf") {
pdf += "?fileType=pdf"
}
sku.Pdf = pdf
}
......
......@@ -32,6 +32,8 @@ func (ls *LyService) GetGoodsImages(sku model.LySku, spu string) model.LySku {
if strings.Contains(sku.GoodsImages, "rocelec") {
sku.GoodsImages = ""
}
sku.GoodsImages = strings.Replace(sku.GoodsImages, "http://img.ichunt.com", "https://img.ichunt.com", 1)
sku.ImagesL = strings.Replace(sku.ImagesL, "http://img.ichunt.com", "https://img.ichunt.com", 1)
return sku
}
......
......@@ -18,7 +18,7 @@ type TagsService struct {
const TagZiyingSku = 4
//获取Spu的属性
func (ts *TagsService) GetTags(skuId string,self_supplier_type int64) (goodsTags model.GoodsTag) {
func (ts *TagsService) GetTags(skuId string, self_supplier_type int64) (goodsTags model.GoodsTag) {
redisCon := gredis.Conn("default_r")
defer redisCon.Close()
goodsTagsStr, _ := redis.String(redisCon.Do("HGET", "goods_tag", skuId))
......@@ -39,6 +39,15 @@ func (ts *TagsService) GetTags(skuId string,self_supplier_type int64) (goodsTags
tagNames = append(tagNames, tagName)
tags = append(tags, int(tagResult.Int()))
}
//todo hcy 2023.1.10 增加额外商品标签
customerTag := gjson.Get(goodsTagsStr, "customer_tag").String()
if customerTag != "" {
customerTagArr := php2go.Explode(" ", php2go.Trim(customerTag))
for _, cname := range customerTagArr {
tagNames = append(tagNames, cname)
}
}
}
//如果是自营商品Id,就写死当天发货标签
if len(skuId) < 10 && self_supplier_type == 1 {
......
......@@ -214,13 +214,17 @@ func (qs *ZiyingService) ZyGoodsDetail(ctx *gin.Context, goodsIds []string, ch c
if img != "" {
goodsImages, _ = gredis.String(redisConn.Do("HGET", "Self_SelfGoodsSource", img))
}
A.Set("goods_images", gjson.Get(goodsImages, "url").String())
image := gjson.Get(goodsImages, "url").String()
image = strings.Replace(image, "http://img.ichunt.com", "https://img.ichunt.com", 1)
A.Set("goods_images", image)
pdf := gjson.Get(info, "pdf").String()
if pdf != "" {
pdf, _ = gredis.String(redisConn.Do("HGET", "Self_SelfGoodsSource", pdf))
}
A.Set("pdf", gjson.Get(pdf, "url").String())
pdf = gjson.Get(pdf, "url").String()
pdf = strings.Replace(pdf, "http://img.ichunt.com", "https://img.ichunt.com", 1)
A.Set("pdf", pdf)
}
A.Set("scm_brand_name", gjson.Get(info, "scm_brand_name").String()) //
......
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