Skip to content

Commit 876ce14

Browse files
committed
fix(control): 查询对应用户的数据
1 parent 0935daf commit 876ce14

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

laravel/app/Http/Controllers/Api/ApiExcelController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,14 @@ public function __construct(Request $request)
5151
*/
5252
public function index()
5353
{
54-
$list = ApiExcel::with('apiParam')->orderBy('id', 'desc')->paginate($this->perPage);
54+
$user_id = auth('api')->user()['id'];
55+
56+
// 查询对应用户的上传数据
57+
$where = [];
58+
if ($user_id != 1) {
59+
$where = ['uid' => $user_id];
60+
}
61+
$list = ApiExcel::with('apiParam')->where($where)->orderBy('id', 'desc')->paginate($this->perPage);
5562

5663
$appUrl = env('APP_URL') ?? '';
5764
$collect = collect(['appUrl' => $appUrl]);

0 commit comments

Comments
 (0)