1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-22 03:32:47 +08:00
course-tencent-cloud/app/Repos/ChapterLike.php
2020-07-12 19:40:31 +08:00

25 lines
539 B
PHP

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