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
8665b60e
Commit
8665b60e
authored
Aug 07, 2025
by
邱阿朋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(vc): 修复广告费和产品销售数据处理问题
-修复了加拿大站点广告费数据的提取问题 - 增加了对空 ASIN 或零金额的检查和日志记录 - 统一了产品销售数据中的 Ordered Units 字段名
parent
af4e006d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
advert_cost.py
app/vc/advert_cost.py
+7
-0
product_sales.py
app/vc/product_sales.py
+2
-0
No files found.
app/vc/advert_cost.py
View file @
8665b60e
...
...
@@ -124,10 +124,17 @@ class AdvertCost(AutoInterface):
elif
self
.
country
==
"JP"
:
asin
=
item_row
.
get
(
'商品'
,
''
)
.
split
(
"-"
)[
0
]
spend
=
item_row
.
get
(
'花费(JPY)'
,
0.00
),
# 金额
elif
self
.
country
==
"CA"
:
asin
=
item_row
.
get
(
'Products'
,
''
)
.
split
(
"-"
)[
0
]
spend
=
item_row
.
get
(
'Spend(CAD)'
,
0.00
),
# 金额
else
:
asin
=
''
spend
=
0.00
if
asin
==
''
or
spend
==
0.00
:
self
.
logger
.
warning
(
f
"asin为空或无金额"
)
continue
if
isinstance
(
spend
,
tuple
):
spend
=
float
(
spend
[
0
])
...
...
app/vc/product_sales.py
View file @
8665b60e
...
...
@@ -71,6 +71,8 @@ class ProductSales(AutoInterface):
# 统一字段名(只处理 Ordered Revenue 大小写问题)
if
'Ordered Revenue'
not
in
df
.
columns
and
'Ordered revenue'
in
df
.
columns
:
df
.
rename
(
columns
=
{
'Ordered revenue'
:
'Ordered Revenue'
},
inplace
=
True
)
if
'Ordered Units'
not
in
df
.
columns
and
'Ordered units'
in
df
.
columns
:
df
.
rename
(
columns
=
{
'Ordered units'
:
'Ordered Units'
},
inplace
=
True
)
# 过滤掉 Ordered Revenue <= 0 的数据
data
=
df
[
df
[
'Ordered Revenue'
]
>
0
]
...
...
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