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
411c6eb6
Commit
411c6eb6
authored
Jul 03, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cp_pairs_stat.go
parent
3ce585dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
16 deletions
+74
-16
cp_pairs_stat.go
script/cp_pairs_stat.go
+74
-16
No files found.
script/cp_pairs_stat.go
View file @
411c6eb6
...
...
@@ -78,6 +78,14 @@ type CpInfo struct {
Points
uint64
CreatedTime
time
.
Time
Charge
float64
M1
int
M2
int
M3
int
M4
int
M5
int
M6
int
M7
int
ModifyAnniversary
int
}
type
CpLevel
struct
{
...
...
@@ -128,6 +136,7 @@ func main() {
cpInfos
[
i
]
.
UserId2Area
=
getAreaByCode2
(
uM
[
v
.
UserId2
]
.
Code
)
cpInfos
[
i
]
.
Points
=
v
.
Points
+
CpLevelPoints
[
v
.
Level
]
cpInfos
[
i
]
.
Charge
=
float64
(
getChargeMoneyDiamond
(
v
.
UserId1
,
v
.
CreatedTime
)
+
getChargeMoneyDiamond
(
v
.
UserId2
,
v
.
CreatedTime
))
/
100
cpInfos
[
i
]
.
ModifyAnniversary
,
cpInfos
[
i
]
.
M1
,
cpInfos
[
i
]
.
M2
,
cpInfos
[
i
]
.
M3
,
cpInfos
[
i
]
.
M4
,
cpInfos
[
i
]
.
M5
,
cpInfos
[
i
]
.
M6
,
cpInfos
[
i
]
.
M7
=
modifyAnniversary
(
v
.
Id
)
}
excelFileName
:=
fmt
.
Sprintf
(
"./cp数据.xlsx"
)
xlFile
:=
xlsx
.
NewFile
()
...
...
@@ -136,16 +145,65 @@ func main() {
panic
(
err
)
}
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
,
c7
.
Value
,
c8
.
Value
,
c9
.
Value
=
"cp ID"
,
"userId1"
,
"userId2"
,
"user1区域"
,
"user2区域"
,
"等级"
,
"积分"
,
"绑定后充值金额 $"
,
"绑定时间"
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
,
c10
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c11
,
c12
,
c13
,
c14
,
c15
,
c16
,
c17
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
,
c7
.
Value
,
c8
.
Value
,
c9
.
Value
,
c10
.
Value
=
"cp ID"
,
"userId1"
,
"userId2"
,
"user1区域"
,
"user2区域"
,
"等级"
,
"积分"
,
"绑定后充值金额 $"
,
"绑定时间"
,
"是否修改纪念日"
c11
.
Value
,
c12
.
Value
,
c13
.
Value
,
c14
.
Value
,
c15
.
Value
,
c16
.
Value
,
c17
.
Value
=
"我们在一起"
,
"XXX的生日"
,
"XXX的生日"
,
"第一次说我爱你"
,
"第一次亲吻"
,
"结婚纪念日"
,
"用户自行编辑"
for
_
,
d
:=
range
cpInfos
{
row
:=
sheet
.
AddRow
()
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
,
c7
.
Value
,
c8
.
Value
,
c9
.
Value
=
ats26
(
d
.
Id
),
ats26
(
d
.
Code1
),
ats26
(
d
.
Code2
),
ats26
(
d
.
UserId1Area
),
ats26
(
d
.
UserId2Area
),
ats26
(
d
.
Level
),
ats26
(
d
.
Points
),
ats26
(
d
.
Charge
),
ats26
(
d
.
CreatedTime
.
Format
(
"2006-01-02 15:04:05"
))
c1
,
c2
,
c3
,
c4
,
c5
,
c6
,
c7
,
c8
,
c9
,
c10
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c11
,
c12
,
c13
,
c14
,
c15
,
c16
,
c17
:=
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
(),
row
.
AddCell
()
c1
.
Value
,
c2
.
Value
,
c3
.
Value
,
c4
.
Value
,
c5
.
Value
,
c6
.
Value
,
c7
.
Value
,
c8
.
Value
,
c9
.
Value
,
c10
.
Value
=
ats26
(
d
.
Id
),
ats26
(
d
.
Code1
),
ats26
(
d
.
Code2
),
ats26
(
d
.
UserId1Area
),
ats26
(
d
.
UserId2Area
),
ats26
(
d
.
Level
),
ats26
(
d
.
Points
),
ats26
(
d
.
Charge
),
ats26
(
d
.
CreatedTime
.
Format
(
"2006-01-02 15:04:05"
)),
ats26
(
d
.
ModifyAnniversary
)
c11
.
Value
,
c12
.
Value
,
c13
.
Value
,
c14
.
Value
,
c15
.
Value
,
c16
.
Value
,
c17
.
Value
=
ats26
(
d
.
M1
),
ats26
(
d
.
M2
),
ats26
(
d
.
M3
),
ats26
(
d
.
M4
),
ats26
(
d
.
M5
),
ats26
(
d
.
M6
),
ats26
(
d
.
M7
)
}
_
=
xlFile
.
Save
(
excelFileName
)
//var data []CpPairData
}
type
CpAnniversary
struct
{
CpId
uint64
Sort
int
Type
int
MsgId
int
Timestamp
int
CreatedTime
time
.
Time
`gorm:"->"`
UpdatedTime
time
.
Time
`gorm:"->"`
}
func
modifyAnniversary
(
cpId
uint64
)
(
t
,
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
int
)
{
var
an
[]
CpAnniversary
if
err
:=
mysql
.
ProdReadOnlyDB
.
Model
(
CpAnniversary
{})
.
Where
(
"cp_id = ? AND timestamp > 0 "
,
cpId
)
.
Find
(
&
an
)
.
Error
;
err
!=
nil
{
panic
(
err
)
}
for
_
,
a
:=
range
an
{
if
a
.
MsgId
==
259
&&
a
.
UpdatedTime
.
Second
()
!=
0
{
m1
=
1
}
if
a
.
MsgId
==
260
&&
a
.
Type
==
2
{
m2
=
1
}
if
a
.
MsgId
==
260
&&
a
.
Type
==
3
{
m3
=
1
}
if
a
.
MsgId
==
261
{
m4
=
1
}
if
a
.
MsgId
==
262
{
m5
=
1
}
if
a
.
MsgId
==
263
{
m6
=
1
}
if
a
.
MsgId
==
0
{
m7
++
}
}
if
m1
>
0
||
m2
>
0
||
m3
>
0
||
m4
>
0
||
m5
>
0
||
m6
>
0
||
m7
>
0
{
t
=
1
}
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