Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
185e65b2
Commit
185e65b2
authored
Jun 25, 2018
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学院添加统计评论相关数字API
parent
f5042e1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
xue_favorite.php
example/xue_favorite.php
+4
-0
Comment.php
src/xue/Comment.php
+24
-0
No files found.
example/xue_favorite.php
View file @
185e65b2
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*/
*/
use
internalApi\xue\Favorite
;
use
internalApi\xue\Favorite
;
use
internalApi\xue\Comment
;
require
__DIR__
.
'/_init.php'
;
require
__DIR__
.
'/_init.php'
;
...
@@ -15,6 +16,9 @@ Favorite::setDebug(true);
...
@@ -15,6 +16,9 @@ Favorite::setDebug(true);
//$count = Favorite::countUserFavorites(8);
//$count = Favorite::countUserFavorites(8);
//var_dump($count);
//var_dump($count);
echo
Comment
::
countLikeBetweenTime
(
0
,
1529942399
);
exit
;
$startTime
=
microtime
(
true
);
$startTime
=
microtime
(
true
);
$count
=
\internalApi\xue\Comment
::
getLikeMsgCount
(
8
);
$count
=
\internalApi\xue\Comment
::
getLikeMsgCount
(
8
);
$endTime
=
microtime
(
true
);
$endTime
=
microtime
(
true
);
...
...
src/xue/Comment.php
View file @
185e65b2
...
@@ -40,4 +40,28 @@ class Comment extends Client
...
@@ -40,4 +40,28 @@ class Comment extends Client
return
self
::
call
(
'comment.getReplyMsgCount'
,
compact
(
'uid'
));
return
self
::
call
(
'comment.getReplyMsgCount'
,
compact
(
'uid'
));
}
}
/**
* 统计指定时间段内产生的评论数量
*
* @param int $from
* @param int $to
* @return int
*/
public
static
function
countBetweenTime
(
$from
,
$to
)
{
return
self
::
call
(
'comment.countBetweenTime'
,
compact
(
'from'
,
'to'
));
}
/**
* 统计指定时间段内对评论的赞数量
*
* @param int $from
* @param int $to
* @return int
*/
public
static
function
countLikeBetweenTime
(
$from
,
$to
)
{
return
self
::
call
(
'comment.countLikeBetweenTime'
,
compact
(
'from'
,
'to'
));
}
}
}
\ No newline at end of file
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