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
88bd208a
Commit
88bd208a
authored
Nov 13, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户页面存留时间完成
parent
b5329efd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
1 deletion
+109
-1
StatisticsServiceContract.php
app/Contracts/StatisticsServiceContract.php
+1
-0
StatisticsController.php
app/Http/Controllers/StatisticsController.php
+8
-1
StatisticsService.php
app/Services/StatisticsService.php
+98
-0
web.php
routes/web.php
+2
-0
No files found.
app/Contracts/StatisticsServiceContract.php
View file @
88bd208a
...
...
@@ -19,6 +19,7 @@ interface StatisticsServiceContract
public
function
ReturnVisit
();
public
function
UserRetention
();
public
function
AverageUserOperation
();
public
function
PageRetentionTime
();
}
\ No newline at end of file
app/Http/Controllers/StatisticsController.php
View file @
88bd208a
...
...
@@ -83,7 +83,14 @@ class StatisticsController extends Controller
public
function
AverageUserOperation
()
{
$data
=
$this
->
mStatistics
->
AverageUserOperation
();
dd
(
$data
);
return
$data
;
}
public
function
RetentionTime
()
{
$data
=
$this
->
mStatistics
->
PageRetentionTime
();
return
$data
;
}
}
app/Services/StatisticsService.php
View file @
88bd208a
...
...
@@ -292,6 +292,104 @@ class StatisticsService implements StatisticsServiceContract
// 页面存留时间
public
function
PageRetentionTime
()
{
$userInfo
=
UserInfo
::
all
();
if
(
!
$userInfo
->
isEmpty
()){
$a
=
0
;
$b
=
0
;
$c
=
0
;
$d
=
0
;
$e
=
0
;
$f
=
0
;
$g
=
0
;
$h
=
0
;
$i
=
0
;
$j
=
0
;
$k
=
0
;
$l
=
0
;
$m
=
0
;
$n
=
0
;
$o
=
0
;
$p
=
0
;
foreach
(
$userInfo
as
$info
){
if
(
count
(
json_decode
(
$info
[
'page_retention_time'
]))
>
0
){
$pageTime
=
json_decode
(
$info
[
'page_retention_time'
]);
foreach
(
$pageTime
as
$page
){
if
(
$page
->
id
==
1
){
$a
+=
$page
->
time
;
}
if
(
$page
->
id
==
2
){
$b
+=
$page
->
time
;
}
if
(
$page
->
id
==
3
){
$c
+=
$page
->
time
;
}
if
(
$page
->
id
==
4
){
$d
+=
$page
->
time
;
}
if
(
$page
->
id
==
5
){
$e
+=
$page
->
time
;
}
if
(
$page
->
id
==
6
){
$f
+=
$page
->
time
;
}
if
(
$page
->
id
==
7
){
$g
+=
$page
->
time
;
}
if
(
$page
->
id
==
8
){
$h
+=
$page
->
time
;
}
if
(
$page
->
id
==
9
){
$i
+=
$page
->
time
;
}
if
(
$page
->
id
==
10
){
$j
+=
$page
->
time
;
}
if
(
$page
->
id
==
11
){
$k
+=
$page
->
time
;
}
if
(
$page
->
id
==
12
){
$l
+=
$page
->
time
;
}
if
(
$page
->
id
==
13
){
$m
+=
$page
->
time
;
}
if
(
$page
->
id
==
14
){
$n
+=
$page
->
time
;
}
if
(
$page
->
id
==
15
){
$o
+=
$page
->
time
;
}
if
(
$page
->
id
==
16
){
$p
+=
$page
->
time
;
}
}
}
}
// 获取全部用户
$users
=
UserInfo
::
all
()
->
count
();
$invitation
=
ceil
(
round
(
$a
/
$users
))
.
's'
;
$timeline
=
ceil
(
round
(
$b
/
$users
))
.
's'
;
$project
=
ceil
(
round
(
$c
/
$users
))
.
's'
;
$filemanage
=
ceil
(
round
(
$d
/
$users
))
.
's'
;
$mine
=
ceil
(
round
(
$e
/
$users
))
.
's'
;
$company
=
ceil
(
round
(
$f
/
$users
))
.
's'
;
$myteam
=
ceil
(
round
(
$g
/
$users
))
.
's'
;
$mission
=
ceil
(
round
(
$h
/
$users
))
.
's'
;
$project_item
=
ceil
(
round
(
$i
/
$users
))
.
's'
;
$login
=
ceil
(
round
(
$j
/
$users
))
.
's'
;
$register
=
ceil
(
round
(
$k
/
$users
))
.
's'
;
$discussion
=
ceil
(
round
(
$l
/
$users
))
.
's'
;
$mission_settings
=
ceil
(
round
(
$m
/
$users
))
.
's'
;
$search_team
=
ceil
(
round
(
$n
/
$users
))
.
's'
;
$bangding_phone
=
ceil
(
round
(
$o
/
$users
))
.
's'
;
$search_user
=
ceil
(
round
(
$p
/
$users
))
.
's'
;
// dd($invitation,$timeline,$project,$filemanage,$mine,$company,$myteam,$mission,$project_item,$login,$register,$discussion,$mission_settings,$search_team,$bangding_phone
// ,$search_user
// );
$data
=
[
$invitation
,
$timeline
,
$project
,
$filemanage
,
$mine
,
$company
,
$myteam
,
$mission
,
$project_item
,
$login
,
$register
,
$discussion
,
$mission_settings
,
$search_team
,
$bangding_phone
,
$search_user
];
return
$data
;
}
}
...
...
routes/web.php
View file @
88bd208a
...
...
@@ -87,6 +87,8 @@ Route::group(['prefix'=> 'statistics'],function (){
Route
::
get
(
'return_visit'
,
'StatisticsController@ReturnVisit'
)
->
name
(
'statistics.ReturnVisit'
);
Route
::
get
(
'user_retention'
,
'StatisticsController@UserRetention'
)
->
name
(
'statistics.UserRetention'
);
Route
::
get
(
'average_user_operation'
,
'StatisticsController@AverageUserOperation'
)
->
name
(
'statistics.AverageUserOperation'
);
Route
::
get
(
'retention_time'
,
'StatisticsController@RetentionTime'
)
->
name
(
'statistics.RetentionTime'
);
});
...
...
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