1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-28 13:21:37 +08:00
course-tencent-cloud/app/Repos/CoursePackage.php
2019-12-13 00:10:10 +08:00

41 lines
924 B
PHP

<?php
namespace App\Repos;
use App\Models\CoursePackage as CoursePackageModel;
class CoursePackage extends Repository
{
public function findCoursePackage($courseId, $packageId)
{
$result = CoursePackageModel::query()
->where('course_id = :course_id:', ['course_id' => $courseId])
->andWhere('package_id = :package_id:', ['package_id' => $packageId])
->orderBy('id DESC')
->execute()
->getFirst();
return $result;
}
public function findByCategoryIds($packageIds)
{
$result = CoursePackageModel::query()
->inWhere('package_id', $packageIds)
->execute();
return $result;
}
public function findByCourseIds($courseIds)
{
$result = CoursePackageModel::query()
->inWhere('course_id', $courseIds)
->execute();
return $result;
}
}