1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-23 03:50:56 +08:00
course-tencent-cloud/app/Repos/ChapterVote.php
2020-04-03 19:20:46 +08:00

25 lines
539 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)
{
return ChapterVoteModel::findFirst([
'conditions' => 'chapter_id = :chapter_id: AND user_id = :user_id:',
'bind' => ['chapter_id' => $chapterId, 'user_id' => $userId],
]);
}
}