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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 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 {
ItemName
string
`json:"item_name"`
Pic
string
`json:"pic"`
Remark
string
`json:"remark"`
Content
string
`json:"content"`
AddTime
int
`json:"add_time"`
}
...
...
model/ly_sku.go
View file @
f05fb3d6
...
...
@@ -70,6 +70,9 @@ type LySku struct {
type
PriceActivity
struct
{
ActivityCommon
Ratio
float64
`json:"ratio"`
SignText
string
`json:"sign_text"`
Sign
string
`json:"sign"`
ShowName
string
`json:"show_name"`
}
type
GiftActivity
struct
{
...
...
@@ -82,9 +85,6 @@ type ActivityCommon struct {
ActivityId
int
`json:"activity_id,omitempty"`
ActivityName
string
`json:"activity_name,omitempty"`
AllowCoupon
int
`json:"-"`
SignText
string
`json:"sign_text"`
Sign
string
`json:"sign"`
ShowName
string
`json:"show_name"`
}
//为什么不直接映射到结构,而要用gjson,因为redis存的数据结构不一定正常,可能类型不一致
...
...
service/service_activity.go
View file @
f05fb3d6
...
...
@@ -90,6 +90,10 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
}
INFO
:
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
.
ActivityId
=
activity
.
ActivityId
giftActivity
=
model
.
GiftActivity
{
...
...
@@ -99,9 +103,6 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
AllowCoupon
:
activity
.
AllowCoupon
,
SignText
:
activity
.
SignText
,
Sign
:
activity
.
Sign
,
ShowName
:
activity
.
ShowName
,
},
}
}
...
...
@@ -173,14 +174,14 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
priceActivity
.
ActivityId
=
activity
.
ActivityId
priceActivity
=
model
.
PriceActivity
{
Ratio
:
activity
.
Ratio
,
SignText
:
activity
.
SignText
,
Sign
:
activity
.
Sign
,
ShowName
:
activity
.
ShowName
,
ActivityCommon
:
model
.
ActivityCommon
{
HasActivity
:
hasActivity
,
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
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