mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-24 04:01:31 +08:00
25 lines
539 B
PHP
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],
|
|
]);
|
|
}
|
|
|
|
}
|