Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bf33586b
authored
Dec 16, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
ssh://119.23.72.7:22611/q578953158/go_sku_server
parents
c755e533
9a5e6eb1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
108 deletions
pkg/common/function.go
service/service_ly.go
service/service_ly_common.go
pkg/common/function.go
View file @
bf33586b
This diff is collapsed.
Click to expand it.
service/service_ly.go
View file @
bf33586b
...
...
@@ -201,8 +201,6 @@ func (ls *LyService) getSpuList(skuArr map[string]string) (spuList map[string]st
spuId
:=
gjson
.
Get
(
skuStr
,
"spu_id"
)
.
String
()
spuIds
=
append
(
spuIds
,
spuId
)
}
redisConn
:=
gredis
.
Conn
(
"default_r"
)
defer
redisConn
.
Close
()
//批量获取spu详情
spuList
=
gredis
.
Hmget
(
"default_r"
,
"spu"
,
spuIds
)
return
...
...
service/service_ly_common.go
View file @
bf33586b
...
...
@@ -279,6 +279,7 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku {
}
if
!
hasCoefficient
&&
!
hasDefault
{
logger
.
Error
(
"%s"
,
"系数获取异常,供应商:"
+
common
.
ToString
(
sku
.
SupplierId
))
sku
.
Content
=
"系数获取异常,供应商:"
+
common
.
ToString
(
sku
.
SupplierId
)
return
sku
}
...
...
@@ -339,13 +340,13 @@ func (ls *LyService) GetCoefficient(sku model.LySku) model.LySku {
}
}
}
if
len
(
data
)
>
0
{
sku
.
LadderPrice
=
data
}
//输出税费到前端
coefficient
.
Tax
=
tax
sku
.
Coefficient
=
coefficient
}
if
len
(
data
)
>
0
{
sku
.
LadderPrice
=
data
}
return
sku
}
...
...
@@ -393,19 +394,14 @@ func (ls *LyService) GetIsBuy(sku model.LySku) (isBuy int) {
//合并spu的信息
func
(
ls
*
LyService
)
CombineSup
(
sku
model
.
LySku
,
spuStr
string
)
model
.
LySku
{
var
spu
model
.
Spu
err
:=
json
.
Unmarshal
([]
byte
(
spuStr
),
&
spu
)
if
err
!=
nil
{
return
sku
}
sku
.
UpdateTime
=
spu
.
UpdateTime
sku
.
ClassID1
=
spu
.
ClassID1
sku
.
ClassID2
=
spu
.
ClassID2
sku
.
SpuName
=
spu
.
SpuName
sku
.
SpuBrief
=
spu
.
SpuBrief
sku
.
SpuDetail
=
spu
.
SpuDetail
sku
.
Status
=
spu
.
Status
sku
.
Encap
=
spu
.
Encap
sku
.
UpdateTime
=
gjson
.
Get
(
spuStr
,
"update_time"
)
.
Int
()
sku
.
ClassID1
=
int
(
gjson
.
Get
(
spuStr
,
"class_id1"
)
.
Int
())
sku
.
ClassID2
=
int
(
gjson
.
Get
(
spuStr
,
"class_id2"
)
.
Int
())
sku
.
SpuName
=
gjson
.
Get
(
spuStr
,
"spu_name"
)
.
String
()
sku
.
SpuBrief
=
gjson
.
Get
(
spuStr
,
"spu_brief"
)
.
String
()
sku
.
SpuDetail
=
gjson
.
Get
(
spuStr
,
"spu_detail"
)
.
String
()
sku
.
Status
=
int
(
gjson
.
Get
(
spuStr
,
"status"
)
.
Int
())
sku
.
Encap
=
gjson
.
Get
(
spuStr
,
"encap"
)
.
String
()
return
sku
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment