Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
financial-system
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
xianyang
financial-system
Commits
ee72d935
Commit
ee72d935
authored
Apr 17, 2023
by
xianyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化消费类型再分类汇总
parent
1dac305d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
crud.py
app/api/export/crud.py
+4
-4
No files found.
app/api/export/crud.py
View file @
ee72d935
...
@@ -231,7 +231,7 @@ class ReferenceTypeClassification():
...
@@ -231,7 +231,7 @@ class ReferenceTypeClassification():
def
classification_summary
(
self
):
def
classification_summary
(
self
):
data_sql
=
f
"select uuid,type,
amount
/1000 as amount,create_time from {self.date} where reference_type='{self.reference_type}' GROUP BY uuid,type"
data_sql
=
f
"select uuid,type,
sum(amount)
/1000 as amount,create_time from {self.date} where reference_type='{self.reference_type}' GROUP BY uuid,type"
guild_sql
=
f
"select uuid from guild"
guild_sql
=
f
"select uuid from guild"
account_sql
=
f
"select uuid,name from fi_account"
account_sql
=
f
"select uuid,name from fi_account"
anchor_sql
=
f
"select uuid from v2_user where is_achor in(1,2)"
anchor_sql
=
f
"select uuid from v2_user where is_achor in(1,2)"
...
@@ -257,9 +257,9 @@ class ReferenceTypeClassification():
...
@@ -257,9 +257,9 @@ class ReferenceTypeClassification():
op
[
'money'
]
=
round
(
float
(
op
[
'amount'
]),
2
)
op
[
'money'
]
=
round
(
float
(
op
[
'amount'
]),
2
)
if
op
.
get
(
'uuid'
)
in
guild_data
:
if
op
.
get
(
'uuid'
)
in
guild_data
:
op
[
'nickname'
]
=
'公会'
op
[
'nickname'
]
=
'公会'
if
op
.
get
(
'uuid'
)
in
anchor_data
:
el
if
op
.
get
(
'uuid'
)
in
anchor_data
:
op
[
'nickname'
]
=
'主播'
op
[
'nickname'
]
=
'主播'
if
account_dict
.
get
(
op
[
'uuid'
]):
el
if
account_dict
.
get
(
op
[
'uuid'
]):
op
[
'nickname'
]
=
account_dict
.
get
(
op
[
'uuid'
])
op
[
'nickname'
]
=
account_dict
.
get
(
op
[
'uuid'
])
else
:
else
:
op
[
'nickname'
]
=
'用户'
op
[
'nickname'
]
=
'用户'
...
@@ -277,6 +277,6 @@ class ReferenceTypeClassification():
...
@@ -277,6 +277,6 @@ class ReferenceTypeClassification():
if
self
.
income
:
if
self
.
income
:
income
=
pd
.
DataFrame
(
self
.
income
)
income
=
pd
.
DataFrame
(
self
.
income
)
igs
=
income
.
groupby
(
"nickname"
)
.
sum
()
igs
=
income
.
groupby
(
"nickname"
)
.
sum
()
for
k
,
v
in
igs
.
to_dict
()
.
get
(
'money'
)
.
items
():
for
k
,
v
in
igs
.
to_dict
()
.
get
(
'money'
)
.
items
():
res_list
.
append
({
"type"
:
"入账"
,
"name"
:
k
,
"money"
:
v
})
res_list
.
append
({
"type"
:
"入账"
,
"name"
:
k
,
"money"
:
v
})
return
res_list
return
res_list
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