1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 20:00:27 +08:00
course-tencent-cloud/app/Repos/ChapterVote.php
2020-03-16 15:33:36 +08:00

27 lines
567 B
PHP

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