Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dt_analysis
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
haoyanbin
dt_analysis
Commits
fd26df33
Commit
fd26df33
authored
Sep 12, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ab9534cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
survey.go
api/mobile/survey.go
+6
-0
survey.go
model/request/survey.go
+1
-0
survey.go
service/survey.go
+1
-1
No files found.
api/mobile/survey.go
View file @
fd26df33
...
@@ -305,8 +305,13 @@ func ExportSurveyLogPageList(c *gin.Context) {
...
@@ -305,8 +305,13 @@ func ExportSurveyLogPageList(c *gin.Context) {
f
.
SetCellValue
(
fileName
,
"G1"
,
"数据来源"
)
f
.
SetCellValue
(
fileName
,
"G1"
,
"数据来源"
)
f
.
SetCellValue
(
fileName
,
"H1"
,
"访问IP"
)
f
.
SetCellValue
(
fileName
,
"H1"
,
"访问IP"
)
f
.
SetCellValue
(
fileName
,
"I1"
,
"访问时间"
)
f
.
SetCellValue
(
fileName
,
"I1"
,
"访问时间"
)
f
.
SetCellValue
(
fileName
,
"J1"
,
"是否识别"
)
for
k
,
v
:=
range
list
{
for
k
,
v
:=
range
list
{
userType
:=
"未识别"
if
v
.
UserType
==
1
{
userType
=
"已识别"
}
a
:=
strconv
.
Itoa
(
k
+
2
)
a
:=
strconv
.
Itoa
(
k
+
2
)
f
.
SetCellValue
(
fileName
,
"A"
+
a
,
v
.
Id
)
f
.
SetCellValue
(
fileName
,
"A"
+
a
,
v
.
Id
)
f
.
SetCellValue
(
fileName
,
"B"
+
a
,
v
.
UserName
)
f
.
SetCellValue
(
fileName
,
"B"
+
a
,
v
.
UserName
)
...
@@ -317,6 +322,7 @@ func ExportSurveyLogPageList(c *gin.Context) {
...
@@ -317,6 +322,7 @@ func ExportSurveyLogPageList(c *gin.Context) {
f
.
SetCellValue
(
fileName
,
"G"
+
a
,
v
.
UserSource
)
f
.
SetCellValue
(
fileName
,
"G"
+
a
,
v
.
UserSource
)
f
.
SetCellValue
(
fileName
,
"H"
+
a
,
v
.
Ip
)
f
.
SetCellValue
(
fileName
,
"H"
+
a
,
v
.
Ip
)
f
.
SetCellValue
(
fileName
,
"I"
+
a
,
utils
.
StringToTime
(
v
.
CreateTime
))
f
.
SetCellValue
(
fileName
,
"I"
+
a
,
utils
.
StringToTime
(
v
.
CreateTime
))
f
.
SetCellValue
(
fileName
,
"J"
+
a
,
userType
)
}
}
// Set active sheet of the workbook.
// Set active sheet of the workbook.
f
.
SetActiveSheet
(
index
)
f
.
SetActiveSheet
(
index
)
...
...
model/request/survey.go
View file @
fd26df33
...
@@ -104,4 +104,5 @@ type GetSurveyLogPageList struct {
...
@@ -104,4 +104,5 @@ type GetSurveyLogPageList struct {
UserSource
string
`gorm:"type:string(255)" json:"user_source"`
UserSource
string
`gorm:"type:string(255)" json:"user_source"`
Ip
string
`gorm:"type:string(255)" json:"ip"`
Ip
string
`gorm:"type:string(255)" json:"ip"`
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
UserType
int
`gorm:"type:int(255)" json:"user_type"`
}
}
service/survey.go
View file @
fd26df33
...
@@ -350,7 +350,7 @@ func GetSurveyLogPageList(req request.GetSurveyLogListReq) []request.GetSurveyLo
...
@@ -350,7 +350,7 @@ func GetSurveyLogPageList(req request.GetSurveyLogListReq) []request.GetSurveyLo
table
:=
" (select moc_id, user_id, page, ip, create_time from survey_log WHERE 1>0 "
+
conditions
+
" group by ip order by create_time asc)sl "
table
:=
" (select moc_id, user_id, page, ip, create_time from survey_log WHERE 1>0 "
+
conditions
+
" group by ip order by create_time asc)sl "
table
+=
" left join customer_user as cu on sl.user_id = cu.id "
table
+=
" left join customer_user as cu on sl.user_id = cu.id "
field
:=
" cu.id, cu.user_name, cu.region, cu.city, cu.worker_name, cu.worker_mobile, cu.user_source"
+
field
:=
" cu.id, cu.user_name, cu.region, cu.city, cu.worker_name, cu.worker_mobile, cu.user_source
, cu.user_type
"
+
", sl.ip, sl.create_time "
", sl.ip, sl.create_time "
list
:=
make
([]
request
.
GetSurveyLogPageList
,
0
)
list
:=
make
([]
request
.
GetSurveyLogPageList
,
0
)
...
...
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