diff --git a/app/Service/ServiceEvaluateService.php b/app/Service/ServiceEvaluateService.php index fee79bd..041a304 100644 --- a/app/Service/ServiceEvaluateService.php +++ b/app/Service/ServiceEvaluateService.php @@ -39,23 +39,8 @@ class ServiceEvaluateService implements ServiceEvaluateServiceInterface { $res = Db::table('lanzu_service_evaluate') ->where(['service_personnel_id' => $service_personnel_id]) - ->limit(4) - ->get(); -// return $res; - $currentPage = 1; - $perPage = 2; - - // 这里根据 $currentPage 和 $perPage 进行数据查询,以下使用 Collection 代替 -// $collection = new Collection([ -// ['id' => 1, 'name' => 'Tom'], -// ['id' => 2, 'name' => 'Sam'], -// ['id' => 3, 'name' => 'Tim'], -// ['id' => 4, 'name' => 'Joe'], -// ]); -// -// $users = array_values($collection->forPage($currentPage, $perPage)->toArray()); - - return new Paginator($res, $perPage, $currentPage); + ->paginate(4); + return $res; } } \ No newline at end of file