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
a821548f
Commit
a821548f
authored
Mar 18, 2024
by
brent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify recharge
parent
f5ba0ec1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
17 deletions
+15
-17
funds.go
controllers/funds.go
+3
-3
task.go
controllers/task.go
+11
-13
cronjob.go
libs/cronjob/cronjob.go
+1
-1
No files found.
controllers/funds.go
View file @
a821548f
...
@@ -44,7 +44,7 @@ func (server *FundsController) Recharge() {
...
@@ -44,7 +44,7 @@ func (server *FundsController) Recharge() {
checkUser
:=
&
models
.
User
{
Id
:
info
.
UserID
}
checkUser
:=
&
models
.
User
{
Id
:
info
.
UserID
}
cond
:=
"id"
cond
:=
"id"
if
chargeRequest
.
Mail
!=
""
{
if
chargeRequest
.
Mail
!=
""
{
checkUser
=
&
models
.
User
{
Id
:
info
.
UserID
}
checkUser
=
&
models
.
User
{
Mail
:
chargeRequest
.
Mail
}
cond
=
"mail"
cond
=
"mail"
}
}
err
=
mysql
.
GetMysqlInstace
()
.
Ormer
.
Read
(
checkUser
,
cond
)
err
=
mysql
.
GetMysqlInstace
()
.
Ormer
.
Read
(
checkUser
,
cond
)
...
@@ -346,10 +346,10 @@ func (server *FundsController) IncomeAndExpense() {
...
@@ -346,10 +346,10 @@ func (server *FundsController) IncomeAndExpense() {
var
responseTypes
[]
models
.
ResponseFunds
var
responseTypes
[]
models
.
ResponseFunds
for
_
,
fund
:=
range
data
{
for
_
,
fund
:=
range
data
{
amountInt
,
_
:=
strconv
.
Atoi
(
fund
.
Amount
)
amountInt
,
_
:=
strconv
.
ParseInt
(
fund
.
Amount
,
10
,
64
)
amount
:=
amountInt
/
1000000
amount
:=
amountInt
/
1000000
balanceInt
,
_
:=
strconv
.
Atoi
(
fund
.
Balance
)
balanceInt
,
_
:=
strconv
.
ParseInt
(
fund
.
Balance
,
10
,
64
)
balance
:=
balanceInt
/
1000000
balance
:=
balanceInt
/
1000000
tradeChannel
,
_
:=
strconv
.
Atoi
(
fund
.
TradeChannel
)
tradeChannel
,
_
:=
strconv
.
Atoi
(
fund
.
TradeChannel
)
...
...
controllers/task.go
View file @
a821548f
...
@@ -1154,22 +1154,20 @@ func (server *TaskController) UserFee() {
...
@@ -1154,22 +1154,20 @@ func (server *TaskController) UserFee() {
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
server
.
respond
(
models
.
BusinessFailed
,
err
.
Error
())
return
return
}
}
//for _, value := range dates {
fee
:=
int64
(
0
)
// tempDate := findTime(counts, value)
for
_
,
value
:=
range
counts
{
// if tempDate != nil {
fee
,
_
=
strconv
.
ParseInt
(
value
.
Fee
,
10
,
64
)
// reTask := models.TaskCount{
}
// Type: "0",
fee
=
fee
/
1000000
// Time: *tempDate,
data
:=
struct
{
// Count: "0",
Fee
int64
`json:"fee"`
// ApiPath: "",
}{
// }
Fee
:
fee
,
// counts = append(counts, reTask)
}
// }
//}
//sort.Slice(counts, func(i, j int) bool {
//sort.Slice(counts, func(i, j int) bool {
// return counts[i].Time.Before(counts[j].Time)
// return counts[i].Time.Before(counts[j].Time)
//})
//})
server
.
respond
(
http
.
StatusOK
,
""
,
counts
)
server
.
respond
(
http
.
StatusOK
,
""
,
data
)
}
}
func
(
server
*
TaskController
)
UserTaskTypeFeePerDay
()
{
func
(
server
*
TaskController
)
UserTaskTypeFeePerDay
()
{
...
...
libs/cronjob/cronjob.go
View file @
a821548f
...
@@ -160,7 +160,7 @@ func startDebit() {
...
@@ -160,7 +160,7 @@ func startDebit() {
id
,
_
:=
snowflake
.
NextId
()
id
,
_
:=
snowflake
.
NextId
()
uid
,
_
:=
strconv
.
Atoi
(
fund
.
Uid
)
uid
,
_
:=
strconv
.
Atoi
(
fund
.
Uid
)
amount
,
_
:=
strconv
.
Atoi
(
fund
.
Amount
)
amount
,
_
:=
strconv
.
ParseInt
(
fund
.
Amount
,
10
,
64
)
nanoseconds
:=
int64
(
uint64
(
dayTime
.
UnixNano
()))
nanoseconds
:=
int64
(
uint64
(
dayTime
.
UnixNano
()))
seconds
:=
nanoseconds
/
1e9
seconds
:=
nanoseconds
/
1e9
...
...
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