mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
use data-table instead lay-table
This commit is contained in:
@@ -57,4 +57,20 @@ class Controller extends BaseController
|
||||
return Str::slug("$title.$action", '.');
|
||||
}
|
||||
|
||||
protected function getPaginationParameters(): array
|
||||
{
|
||||
$request = request();
|
||||
$format = $request->__format;
|
||||
if ($format == 'data-table') {
|
||||
$perPage = $request->length;
|
||||
$page = intval($request->start / $perPage) + 1;
|
||||
} else {
|
||||
$perPage = $request->limit;
|
||||
$page = $request->page;
|
||||
}
|
||||
return [$perPage, ['*'], 'page', $page];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user