Commit 72db797d authored by 夏彬's avatar 夏彬

门户评论点赞或和评论回复添加消息

parent 78dfc5a8
...@@ -211,7 +211,7 @@ function comment($id) { ...@@ -211,7 +211,7 @@ function comment($id) {
//点赞 //点赞
function likeComment($plid) { function likeComment($plid) {
global $empire,$dbtbpre; global $empire,$dbtbpre,$ecms_config;
$tablecomment = $dbtbpre.'ecms_comments'; $tablecomment = $dbtbpre.'ecms_comments';
$tablecommentlike = $dbtbpre.'ecms_comments_likenum'; $tablecommentlike = $dbtbpre.'ecms_comments_likenum';
...@@ -236,6 +236,21 @@ function likeComment($plid) { ...@@ -236,6 +236,21 @@ function likeComment($plid) {
if ($id) { if ($id) {
$sql = "update {$tablecomment} set like_num=like_num+1 where id={$plid}"; $sql = "update {$tablecomment} set like_num=like_num+1 where id={$plid}";
$empire->query($sql); $empire->query($sql);
//添加消息
$tablenews = $dbtbpre . 'ecms_news';
$newsid = $comment['newsid'];
$sql = "select * from {$tablenews} where id={$newsid}";
$news = $empire->fetchassoc1($sql);
$userId = getucidbyuid($comment['user_id']);
$title = $news['title'];
$sourceUrl = $ecms_config['site_url'] . $news['titleurl'];
$sourceId = $newsid;
$type = 'comment';
$likeUserId = $user['ucid'];
$likedComment = $comment['content'];
\internalApi\ucenter\Message::addLike($userId, $title, $sourceUrl, 's', $type, $sourceId, $likeUserId,$likedComment);
returnmsg(true, '点赞成功'); returnmsg(true, '点赞成功');
} else { } else {
returnmsg(false, '点赞失败'); returnmsg(false, '点赞失败');
......
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