Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amazon_reports
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
common
amazon_reports
Commits
e8a92103
Commit
e8a92103
authored
Jul 24, 2025
by
邱阿朋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(advert_cost): 重构广告费用计算逻辑
-增加对美国站点的支持 - 优化日本站点的数据处理方式- 添加默认值处理,避免空值导致的错误 - 修复花费金额的数据类型问题
parent
9e9ce32b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
advert_cost.py
app/vc/advert_cost.py
+10
-5
No files found.
app/vc/advert_cost.py
View file @
e8a92103
...
@@ -117,12 +117,17 @@ class AdvertCost(AutoInterface):
...
@@ -117,12 +117,17 @@ class AdvertCost(AutoInterface):
data
=
pd
.
read_excel
(
self
.
result_file_name
,
keep_default_na
=
False
,
na_values
=
[])
data
=
pd
.
read_excel
(
self
.
result_file_name
,
keep_default_na
=
False
,
na_values
=
[])
for
_
,
item_row
in
data
.
iterrows
():
for
_
,
item_row
in
data
.
iterrows
():
if
self
.
country
==
"US"
:
asin
=
item_row
.
get
(
'Products'
,
''
)
.
split
(
"-"
)[
0
]
asin
=
item_row
.
get
(
'Products'
,
''
)
.
split
(
"-"
)[
0
]
spend
=
item_row
.
get
(
'Spend(USD)'
,
''
),
# 金额
spend
=
item_row
.
get
(
'Spend(USD)'
,
0.00
),
# 金额
elif
self
.
country
==
"JP"
:
if
self
.
country
==
'JP'
:
asin
=
item_row
.
get
(
'商品'
,
''
)
.
split
(
"-"
)[
0
]
asin
=
item_row
.
get
(
'商品'
,
''
)
.
split
(
"-"
)[
0
]
spend
=
item_row
.
get
(
'花费(JPY)'
,
''
),
# 金额
spend
=
item_row
.
get
(
'花费(JPY)'
,
0.00
),
# 金额
if
isinstance
(
spend
,
tuple
):
spend
=
float
(
spend
[
0
])
else
:
asin
=
''
spend
=
0.00
push_data
=
{
push_data
=
{
'asin'
:
asin
,
# ASIN
'asin'
:
asin
,
# ASIN
...
...
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