Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
60629c34
Commit
60629c34
authored
Nov 15, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成页面停留时间显示
parent
4df8c4f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
41 deletions
+111
-41
StatisticsController.php
app/Http/Controllers/StatisticsController.php
+6
-1
StatisticsService.php
app/Services/StatisticsService.php
+16
-16
index.blade.php
resources/views/admin/index.blade.php
+89
-24
No files found.
app/Http/Controllers/StatisticsController.php
View file @
60629c34
...
...
@@ -91,7 +91,12 @@ class StatisticsController extends Controller
// 页面停留时间
public
function
RetentionTime
()
{
$data
=
$this
->
mStatistics
->
PageRetentionTime
();
$retentionTime
=
$this
->
mStatistics
->
PageRetentionTime
();
$data
=
[];
foreach
(
$retentionTime
as
$key
=>
$v
){
$data
[
0
][]
=
$key
;
$data
[
1
][]
=
[
'value'
=>
$v
];
}
return
$data
;
}
...
...
app/Services/StatisticsService.php
View file @
60629c34
...
...
@@ -348,22 +348,22 @@ class StatisticsService implements StatisticsServiceContract
// 获取全部用户
$users
=
UserInfo
::
all
()
->
count
();
$invitation
=
ceil
(
$a
/
$users
)
.
's'
;
$timeline
=
ceil
(
$b
/
$users
)
.
's'
;
$project
=
ceil
(
$c
/
$users
)
.
's'
;
$filemanage
=
ceil
(
$d
/
$users
)
.
's'
;
$mine
=
ceil
(
$e
/
$users
)
.
's'
;
$company
=
ceil
(
$f
/
$users
)
.
's'
;
$myteam
=
ceil
(
$g
/
$users
)
.
's'
;
$mission
=
ceil
(
$h
/
$users
)
.
's'
;
$project_item
=
ceil
(
$i
/
$users
)
.
's'
;
$login
=
ceil
(
$j
/
$users
)
.
's'
;
$register
=
ceil
(
$k
/
$users
)
.
's'
;
$discussion
=
ceil
(
$l
/
$users
)
.
's'
;
$mission_settings
=
ceil
(
$m
/
$users
)
.
's'
;
$search_team
=
ceil
(
$n
/
$users
)
.
's'
;
$bangding_phone
=
ceil
(
$o
/
$users
)
.
's'
;
$search_user
=
ceil
(
$p
/
$users
)
.
's'
;
$invitation
=
ceil
(
$a
/
$users
);
$timeline
=
ceil
(
$b
/
$users
);
$project
=
ceil
(
$c
/
$users
);
$filemanage
=
ceil
(
$d
/
$users
);
$mine
=
ceil
(
$e
/
$users
);
$company
=
ceil
(
$f
/
$users
);
$myteam
=
ceil
(
$g
/
$users
);
$mission
=
ceil
(
$h
/
$users
);
$project_item
=
ceil
(
$i
/
$users
);
$login
=
ceil
(
$j
/
$users
);
$register
=
ceil
(
$k
/
$users
);
$discussion
=
ceil
(
$l
/
$users
);
$mission_settings
=
ceil
(
$m
/
$users
);
$search_team
=
ceil
(
$n
/
$users
);
$bangding_phone
=
ceil
(
$o
/
$users
);
$search_user
=
ceil
(
$p
/
$users
);
$data
=
[
'invitation'
=>
$invitation
,
'timeline'
=>
$timeline
,
'project'
=>
$project
,
'filemanage'
=>
$filemanage
,
'mine'
=>
$mine
,
'company'
=>
$company
,
'myteam'
=>
$myteam
,
'mission'
=>
$mission
,
'project_item'
=>
$project_item
,
'login'
=>
$login
,
'register'
=>
$register
,
'discussion'
=>
$discussion
,
'mission_settings'
=>
$mission_settings
,
'search_team'
=>
$search_team
,
'bangding_phone'
=>
$bangding_phone
,
'search_user'
=>
$search_user
];
...
...
resources/views/admin/index.blade.php
View file @
60629c34
...
...
@@ -108,26 +108,9 @@
<
div
class
=
"row"
>
{{
--<
div
style
=
"width: 728px;height: 200px;background-color: #f0f0f0;border: 1px solid #D2D6DE;float: right;"
>--
}}
<
div
class
=
"col-lg-6 col-md-12"
style
=
"width: 808px;height: 200px;background-color: #f0f0f0;border: 1px solid #D2D6DE;float: right;margin: 70px 15px 0 0;"
>
<
p
style
=
"margin-left: 265px;"
>
新增用户占总用户百分比数据图666
</
p
>
<
div
style
=
"width: 220px;height: 150px;float: left; margin-top:2px;margin-left: 15px; line-height: 150px;"
>
昨日新增用户数
:
<
span
style
=
"font-family:'微软雅黑';font-size: 20px;color: #cb2027;"
id
=
"day"
>
</
span
>
</
div
>
<
div
style
=
"float:left;width: 1px;height: 120px; background: #A3A3A3;margin-top: 21px;"
></
div
>
<
div
style
=
"width: 220px;height: 150px;float: left; margin-top: 2px;margin-left: 15px;line-height: 150px;"
>
一周内新增用户数
:
<
span
style
=
"font-family:'微软雅黑';font-size: 20px;color: #cb2027;"
id
=
"week"
>
</
span
>
</
div
>
<
div
style
=
"float:left;width: 1px;height: 120px; background: #A3A3A3;margin-top: 21px;"
></
div
>
<
div
style
=
"width: 220px;height: 150px;float: left; margin-top: 2px;margin-left: 15px;line-height: 150px;"
>
一月内新增用户数
:
<
span
style
=
"font-family:'微软雅黑';font-size: 20px;color: #cb2027;"
id
=
"month"
>
</
span
>
</
div
>
<
div
class
=
"col-lg-6 col-md-12"
style
=
"float: right;"
>
<!--
为ECharts准备一个具备大小
(
宽高
)
的Dom
-->
<
div
id
=
"page_retention_time"
style
=
"width: 600px;height:400px;"
></
div
>
</
div
>
...
...
@@ -154,8 +137,11 @@
// 基于准备好的dom,初始化echarts实例
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'main'
));
var
user_engagement_myChart
=
echarts
.
init
(
document
.
getElementById
(
'user_engagement'
));
var
page_retention_time_myChart
=
echarts
.
init
(
document
.
getElementById
(
'page_retention_time'
));
// ------------------ ajax ---------------//
UserIncrease
();
function
UserIncrease
(){
$
.
ajax
({
...
...
@@ -192,17 +178,39 @@
})
}
retention_time
();
function
retention_time
(){
$
.
ajax
({
type
:
'get'
,
url
:
"
{
{route('statistics.RetentionTime')}
}
"
,
success
:
function
(
data
){
//console.log(data);
axisData
=
data
[
0
]
console
.
log
(
page_retention_time
)
console
.
log
(
page_retention_time
[
'xAxis'
][
0
][
'data'
]
=
data
[
0
]);
console
.
log
(
page_retention_time
[
'series'
][
0
][
'data'
]
=
data
[
1
]);
page_retention_time_myChart
.
setOption
(
page_retention_time
);
},
error
:
function
(
data
)
{
console
.
log
(
data
);
}
})
}
user_engagement
();
function
user_engagement
(){
$
.
ajax
({
type
:
'get'
,
url
:
"
{
{route('statistics.UserEngagement')}
}
"
,
success
:
function
(
data
){
console
.
log
(
data
);
//
console.log(data);
option_user_engagement
[
'legend'
][
'data'
]
=
data
[
0
]
;
console
.
log
(
option_user_engagement
[
'series'
][
0
][
'data'
]);
console
.
log
(
option_user_engagement
[
'series'
][
0
][
'data'
]
=
data
[
1
])
;
console
.
log
(
option_user_engagement
[
'series'
][
0
][
'data'
]);
//
console.log(option_user_engagement['series'][0]['data']);
option_user_engagement
[
'series'
][
0
][
'data'
]
=
data
[
1
]
;
//
console.log(option_user_engagement['series'][0]['data']);
user_engagement_myChart
.
setOption
(
option_user_engagement
);
},
...
...
@@ -212,6 +220,12 @@
})
}
// ------------------ echarts --------------------------------//
var
optiona
=
{
title
:
{
text
:
'流失、活跃、回访占比'
,
...
...
@@ -304,6 +318,57 @@
//app.title = '坐标轴刻度与标签对齐';
var
page_retention_time
=
{
title
:
{
text
:
'平均页面停留时间'
,
//subtext: '纯属虚构',
x
:
'center'
},
color
:
[
'#3398DB'
],
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
// 坐标轴指示器,坐标轴触发有效
type
:
'shadow'
// 默认为直线,可选为:'line' | 'shadow'
}
},
grid
:
{
left
:
'3%'
,
right
:
'4%'
,
bottom
:
'3%'
,
containLabel
:
true
},
xAxis
:
[
{
type
:
'category'
,
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
],
axisTick
:
{
alignWithLabel
:
true
}
}
],
yAxis
:
[
{
type
:
'value'
}
],
series
:
[
{
//name:'直接访问',
type
:
'bar'
,
barWidth
:
'60%'
,
data
:
[
10
,
52
,
200
,
334
,
390
,
330
,
220
]
}
]
};
...
...
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