From 6e1047997b66dc82b8ca2b08158ad1f8258cf209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=8B=BC?= <2468023037@qq.com> Date: Mon, 17 Mar 2025 19:45:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/api/v1/JobuserController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controller/admin/api/v1/JobuserController.php b/app/controller/admin/api/v1/JobuserController.php index 968bfe8..a9ac07b 100644 --- a/app/controller/admin/api/v1/JobuserController.php +++ b/app/controller/admin/api/v1/JobuserController.php @@ -52,7 +52,7 @@ class JobuserController } // 使用 join 进行关联查询 f_id 对应的用户名称 - $users = $query->leftJoin('users as u', 'users.f_id', '=', 'u.id') // 假设 users 表有 id 字段,f_id 关联到父用户 + $query->leftJoin('users as u', 'users.f_id', '=', 'u.id') // 假设 users 表有 id 字段,f_id 关联到父用户 ->select( 'users.id', 'users.username', @@ -66,9 +66,9 @@ class JobuserController 'users.created_at', 'u.username as parent_username' // 选择所需字段,并为父用户用户名起别名 )->where('users.isrobot',0) - ->orderBy('users.id', 'desc')->get(); // 确保按 users 表的 id 排序 - + ->orderBy('users.id', 'desc'); // 确保按 users 表的 id 排序 + $users = $query->paginate($data['pageSize'], ['*'], 'page', $data['current']); // 返回分页结果 return ApiResponse::success(200, $users); }