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
fc1a765a
authored
Dec 09, 2020
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-商品服务-20201013'
parents
c182125f
b910bfb7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
model/ly_sku.go
service/service_ly.go
service/service_ly_common.go
service/service_price.go
model/ly_sku.go
View file @
fc1a765a
...
...
@@ -24,6 +24,7 @@ type LySku struct {
LadderPriceResult
interface
{}
`json:"ladder_price"`
GoodsImages
string
`json:"goods_images"`
Canal
string
`json:"canal"`
IsExpire
int
`json:"is_expire,omitempty"`
Packing
string
`json:"packing"`
GoodsId
string
`json:"goods_id"`
GoodsName
string
`json:"goods_name"`
...
...
@@ -36,7 +37,7 @@ type LySku struct {
BrandId
int64
`json:"brand_id"`
//系数相关
Coefficient
interface
{}
`json:"coefficient,omitempty"`
Original
interface
{}
`json:"original_price"`
Original
interface
{}
`json:"original_price
,omitempty
"`
SuppExtendFee
interface
{}
`json:"supp_extend_fee"`
IsBuy
int
`json:"is_buy"`
//spu信息
...
...
@@ -105,6 +106,9 @@ func InitSkuData(sku string) (data LySku) {
stock
:=
gjson
.
Get
(
sku
,
"stock"
)
.
Int
()
data
.
Stock
=
stock
isExpire
:=
gjson
.
Get
(
sku
,
"is_expire"
)
.
Int
()
data
.
IsExpire
=
int
(
isExpire
)
hkDeliveryTime
:=
gjson
.
Get
(
sku
,
"hk_delivery_time"
)
.
String
()
data
.
HkDeliveryTime
=
hkDeliveryTime
...
...
service/service_ly.go
View file @
fc1a765a
...
...
@@ -122,7 +122,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
//活动标识
hasActivity
:=
false
//判断是否有新客价权利
if
isNewCustomer
==
"true"
{
if
isNewCustomer
==
"true"
||
isNewCustomer
==
"1"
{
//获取新客价
sku
=
ls
.
GetActivityPrice
(
sku
,
"_NewCustomer"
,
power
)
if
sku
.
AcType
>
0
{
...
...
@@ -138,7 +138,7 @@ func (ls *LyService) LyGoodsDetail(ctx *gin.Context, goodsIds []string, ch chan
}
//获取会员价
if
!
hasActivity
&&
power
.
Member
==
"true"
{
if
!
hasActivity
&&
(
power
.
Member
==
"true"
||
power
.
Member
==
"1"
)
{
sku
=
ls
.
GetActivityPrice
(
sku
,
"_Member"
,
power
)
if
sku
.
AcType
>
0
{
hasActivity
=
true
...
...
service/service_ly_common.go
View file @
fc1a765a
...
...
@@ -193,6 +193,7 @@ func (ls *LyService) GetExtendFee(supplierId int64, canal string) interface{} {
//获取系数
func
(
ls
*
LyService
)
GetCoefficient
(
sku
model
.
LySku
)
model
.
LySku
{
if
len
(
sku
.
LadderPrice
)
==
0
{
sku
.
Original
=
nil
return
sku
}
flag
:=
0
...
...
service/service_price.go
View file @
fc1a765a
...
...
@@ -215,8 +215,10 @@ func (ls *LyService) GetActivityPrice(sku model.LySku, suffix string, power Powe
allowNotLogin
=
2
}
sku
.
ActivityInfo
=
map
[
string
]
interface
{}{
"activity_
i
d"
:
gjson
.
Get
(
activityInfo
,
"activity_ad"
)
.
String
(),
"activity_
a
d"
:
gjson
.
Get
(
activityInfo
,
"activity_ad"
)
.
String
(),
"sign_name"
:
gjson
.
Get
(
activityInfo
,
"sign_name"
)
.
String
(),
"id"
:
gjson
.
Get
(
activityInfo
,
"id"
)
.
String
(),
"activity_name"
:
gjson
.
Get
(
activityInfo
,
"activity_name"
)
.
String
(),
"allow_not_login"
:
allowNotLogin
,
}
sku
.
AcType
=
8
...
...
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