mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: add commission history pagination
This commit is contained in:
parent
724abdd49f
commit
446d16c7da
@ -27,8 +27,9 @@ class InviteController extends Controller
|
|||||||
|
|
||||||
public function details(Request $request)
|
public function details(Request $request)
|
||||||
{
|
{
|
||||||
return response([
|
$current = $request->input('current') ? $request->input('current') : 1;
|
||||||
'data' => CommissionLog::where('invite_user_id', $request->user['id'])
|
$pageSize = $request->input('page_size') >= 10 ? $request->input('page_size') : 10;
|
||||||
|
$builder = CommissionLog::where('invite_user_id', $request->user['id'])
|
||||||
->where('get_amount', '>', 0)
|
->where('get_amount', '>', 0)
|
||||||
->select([
|
->select([
|
||||||
'id',
|
'id',
|
||||||
@ -37,7 +38,13 @@ class InviteController extends Controller
|
|||||||
'get_amount',
|
'get_amount',
|
||||||
'created_at'
|
'created_at'
|
||||||
])
|
])
|
||||||
->get()
|
->orderBy('created_at', 'DESC');
|
||||||
|
$total = $builder->count();
|
||||||
|
$details = $builder->forPage($current, $pageSize)
|
||||||
|
->get();
|
||||||
|
return response([
|
||||||
|
'data' => $details,
|
||||||
|
'total' => $total
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
public/theme/v2board/assets/umi.js
vendored
2
public/theme/v2board/assets/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user