1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-24 04:01:31 +08:00
course-tencent-cloud/app/Repos/CommentVote.php
2020-03-16 15:33:36 +08:00

27 lines
567 B
PHP

<?php
namespace App\Repos;
use App\Models\CommentVote as CommentVoteModel;
use Phalcon\Mvc\Model;
class CommentVote extends Repository
{
/**
* @param int $commentId
* @param int $userId
* @return CommentVoteModel|Model|bool
*/
public function findCommentVote($commentId, $userId)
{
$result = CommentVoteModel::findFirst([
'conditions' => 'comment_id = :comment_id: AND user_id = :user_id:',
'bind' => ['comment_id' => $commentId, 'user_id' => $userId],
]);
return $result;
}
}