mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 20:00:27 +08:00
40 lines
890 B
PHP
40 lines
890 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])
|
|
->execute()
|
|
->getFirst();
|
|
|
|
return $result;
|
|
}
|
|
|
|
public function findByPackageIds($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;
|
|
}
|
|
|
|
}
|