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
f05fb3d6
authored
Jan 14, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
b6d2fd2e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
model/activity.go
model/ly_sku.go
service/service_activity.go
model/activity.go
View file @
f05fb3d6
...
@@ -45,6 +45,7 @@ type ActivityItem struct {
...
@@ -45,6 +45,7 @@ type ActivityItem struct {
ItemName
string
`json:"item_name"`
ItemName
string
`json:"item_name"`
Pic
string
`json:"pic"`
Pic
string
`json:"pic"`
Remark
string
`json:"remark"`
Remark
string
`json:"remark"`
Content
string
`json:"content"`
AddTime
int
`json:"add_time"`
AddTime
int
`json:"add_time"`
}
}
...
...
model/ly_sku.go
View file @
f05fb3d6
...
@@ -70,6 +70,9 @@ type LySku struct {
...
@@ -70,6 +70,9 @@ type LySku struct {
type
PriceActivity
struct
{
type
PriceActivity
struct
{
ActivityCommon
ActivityCommon
Ratio
float64
`json:"ratio"`
Ratio
float64
`json:"ratio"`
SignText
string
`json:"sign_text"`
Sign
string
`json:"sign"`
ShowName
string
`json:"show_name"`
}
}
type
GiftActivity
struct
{
type
GiftActivity
struct
{
...
@@ -82,9 +85,6 @@ type ActivityCommon struct {
...
@@ -82,9 +85,6 @@ type ActivityCommon struct {
ActivityId
int
`json:"activity_id,omitempty"`
ActivityId
int
`json:"activity_id,omitempty"`
ActivityName
string
`json:"activity_name,omitempty"`
ActivityName
string
`json:"activity_name,omitempty"`
AllowCoupon
int
`json:"-"`
AllowCoupon
int
`json:"-"`
SignText
string
`json:"sign_text"`
Sign
string
`json:"sign"`
ShowName
string
`json:"show_name"`
}
}
//为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
//为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
...
...
service/service_activity.go
View file @
f05fb3d6
...
@@ -90,6 +90,10 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
...
@@ -90,6 +90,10 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
}
}
INFO
:
INFO
:
if
hasActivity
{
if
hasActivity
{
for
key
,
item
:=
range
activity
.
ItemList
{
activity
.
ItemList
[
key
]
.
Content
=
"订单满"
+
gconv
.
String
(
item
.
Amount
)
+
"元赠"
+
gconv
.
String
(
item
.
ItemName
)
+
"X"
+
gconv
.
String
(
item
.
Num
)
}
giftActivity
.
ActivityName
=
activity
.
ActivityName
giftActivity
.
ActivityName
=
activity
.
ActivityName
giftActivity
.
ActivityId
=
activity
.
ActivityId
giftActivity
.
ActivityId
=
activity
.
ActivityId
giftActivity
=
model
.
GiftActivity
{
giftActivity
=
model
.
GiftActivity
{
...
@@ -99,9 +103,6 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
...
@@ -99,9 +103,6 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
ActivityId
:
activity
.
ActivityId
,
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
ActivityName
:
activity
.
ActivityName
,
AllowCoupon
:
activity
.
AllowCoupon
,
AllowCoupon
:
activity
.
AllowCoupon
,
SignText
:
activity
.
SignText
,
Sign
:
activity
.
Sign
,
ShowName
:
activity
.
ShowName
,
},
},
}
}
}
}
...
@@ -172,15 +173,15 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
...
@@ -172,15 +173,15 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
priceActivity
.
ActivityName
=
activity
.
ActivityName
priceActivity
.
ActivityName
=
activity
.
ActivityName
priceActivity
.
ActivityId
=
activity
.
ActivityId
priceActivity
.
ActivityId
=
activity
.
ActivityId
priceActivity
=
model
.
PriceActivity
{
priceActivity
=
model
.
PriceActivity
{
Ratio
:
activity
.
Ratio
,
Ratio
:
activity
.
Ratio
,
SignText
:
activity
.
SignText
,
Sign
:
activity
.
Sign
,
ShowName
:
activity
.
ShowName
,
ActivityCommon
:
model
.
ActivityCommon
{
ActivityCommon
:
model
.
ActivityCommon
{
HasActivity
:
hasActivity
,
HasActivity
:
hasActivity
,
ActivityId
:
activity
.
ActivityId
,
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
ActivityName
:
activity
.
ActivityName
,
AllowCoupon
:
activity
.
AllowCoupon
,
AllowCoupon
:
activity
.
AllowCoupon
,
SignText
:
activity
.
SignText
,
Sign
:
activity
.
Sign
,
ShowName
:
activity
.
ShowName
,
},
},
}
}
}
}
...
...
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