Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
admin-backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Odysseus
admin-backend
Commits
75f00400
Commit
75f00400
authored
Mar 12, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify recharge
parent
5dbf80ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
funds.go
controllers/funds.go
+6
-11
cronjob.go
libs/cronjob/cronjob.go
+2
-0
No files found.
controllers/funds.go
View file @
75f00400
...
...
@@ -282,15 +282,15 @@ func (server *FundsController) IncomeAndExpense() {
countQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
countQB
.
Select
(
"count(*)"
)
.
From
(
"funds"
)
From
(
"funds"
)
.
Where
(
"uid != '0'"
)
queryQB
,
_
:=
orm
.
NewQueryBuilder
(
"mysql"
)
queryQB
.
Select
(
"*"
)
.
From
(
"funds"
)
From
(
"funds"
)
.
Where
(
"uid != '0'"
)
if
info
.
Role
!=
1
&&
info
.
Role
!=
2
{
countQB
.
Where
(
fmt
.
Sprintf
(
"uid = '%d'"
,
info
.
UserID
))
queryQB
.
Where
(
fmt
.
Sprintf
(
"uid = '%d'"
,
info
.
UserID
))
countQB
.
And
(
fmt
.
Sprintf
(
"uid = '%d'"
,
info
.
UserID
))
queryQB
.
And
(
fmt
.
Sprintf
(
"uid = '%d'"
,
info
.
UserID
))
}
if
appRequest
.
StartTime
!=
""
&&
appRequest
.
EndTime
!=
""
{
...
...
@@ -298,13 +298,8 @@ func (server *FundsController) IncomeAndExpense() {
startTime
:=
fmt
.
Sprintf
(
temp
.
Format
(
format
))
temp
,
_
=
time
.
Parse
(
layout
,
appRequest
.
EndTime
)
endTime
:=
fmt
.
Sprintf
(
temp
.
Format
(
format
))
if
info
.
Role
==
1
||
info
.
Role
==
2
{
countQB
.
Where
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
queryQB
.
Where
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
}
else
{
countQB
.
And
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
queryQB
.
And
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
}
countQB
.
And
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
queryQB
.
And
(
fmt
.
Sprintf
(
"time >= '%s'"
,
startTime
))
.
And
(
fmt
.
Sprintf
(
"time <= '%s'"
,
endTime
))
}
if
appRequest
.
TradeType
!=
0
{
countQB
.
And
(
fmt
.
Sprintf
(
"trade_type = %d"
,
appRequest
.
TradeType
))
...
...
libs/cronjob/cronjob.go
View file @
75f00400
...
...
@@ -132,9 +132,11 @@ func startDebit() {
sql
:=
fmt
.
Sprintf
(
"SELECT time, uid,sum(fee) AS amount FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR GROUP BY uid,time;"
,
start
,
end
)
data
,
err
:=
postgres
.
CountFunds
(
sql
)
if
err
!=
nil
{
logs
.
Debug
(
"startDebit postgres CountFunds = %s"
,
err
.
Error
())
return
}
if
data
==
nil
{
logs
.
Debug
(
"startDebit data = nil"
)
return
}
...
...
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