Commit 185e65b2 authored by 杨培's avatar 杨培

学院添加统计评论相关数字API

parent f5042e1d
...@@ -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);
......
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment