mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 20:52:44 +08:00
40 lines
852 B
PHP
40 lines
852 B
PHP
<?php
|
|
|
|
namespace App\Services\Logic\Course;
|
|
|
|
use App\Library\Paginator\Query as PagerQuery;
|
|
use App\Repos\Consult as ConsultRepo;
|
|
use App\Services\Logic\CourseTrait;
|
|
use App\Services\Logic\Service as LogicService;
|
|
|
|
class ConsultList extends LogicService
|
|
{
|
|
|
|
use CourseTrait;
|
|
use ConsultListTrait;
|
|
|
|
public function handle($id)
|
|
{
|
|
$course = $this->checkCourse($id);
|
|
|
|
$pagerQuery = new PagerQuery();
|
|
|
|
$sort = $pagerQuery->getSort();
|
|
$page = $pagerQuery->getPage();
|
|
$limit = $pagerQuery->getLimit();
|
|
|
|
$params = [
|
|
'course_id' => $course->id,
|
|
'private' => 0,
|
|
'published' => 1,
|
|
];
|
|
|
|
$consultRepo = new ConsultRepo();
|
|
|
|
$pager = $consultRepo->paginate($params, $sort, $page, $limit);
|
|
|
|
return $this->handleConsults($pager);
|
|
}
|
|
|
|
}
|