Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
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
hujiebin
hilo-common
Commits
ccf1c3a7
Commit
ccf1c3a7
authored
Jun 21, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cp_pairs_stat.go
parent
e3be2346
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
cp_pairs_stat.go
script/cp_pairs_stat.go
+3
-1
No files found.
script/cp_pairs_stat.go
View file @
ccf1c3a7
...
...
@@ -83,6 +83,7 @@ type CpInfo struct {
type
CpLevel
struct
{
CpId
uint64
Level
uint64
Points
uint64
CreatedTime
time
.
Time
}
...
...
@@ -96,7 +97,7 @@ func main() {
cpIds
=
append
(
cpIds
,
v
.
Id
)
}
var
cpLevels
[]
CpLevel
if
err
:=
mysql
.
ProdReadOnlyDB
.
Table
(
"cp_level"
)
.
Select
(
"cp_id,level,created_time"
)
.
Where
(
"cp_id in ?"
,
cpIds
)
.
Find
(
&
cpLevels
)
.
Error
;
err
!=
nil
{
if
err
:=
mysql
.
ProdReadOnlyDB
.
Table
(
"cp_level"
)
.
Select
(
"cp_id,level,
points,
created_time"
)
.
Where
(
"cp_id in ?"
,
cpIds
)
.
Find
(
&
cpLevels
)
.
Error
;
err
!=
nil
{
panic
(
err
)
}
var
userIds
[]
uint64
...
...
@@ -107,6 +108,7 @@ func main() {
for
_
,
v2
:=
range
cpLevels
{
if
v
.
Id
==
v2
.
CpId
{
cpInfos
[
i
]
.
Level
=
v2
.
Level
cpInfos
[
i
]
.
Points
=
v2
.
Points
cpInfos
[
i
]
.
CreatedTime
=
v2
.
CreatedTime
break
}
...
...
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