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:
@@ -522,7 +522,7 @@ function api(...$args)
|
||||
$resultKey = 'ret';
|
||||
$msgKey = 'msg';
|
||||
$format = $_REQUEST['__format'] ?? '';
|
||||
if ($format == 'layui-table') {
|
||||
if (in_array($format, ['layui-table', 'data-table'])) {
|
||||
$resultKey = 'code';
|
||||
$count = $data['meta']['total'] ?? 0;
|
||||
if (isset($data['data'])) {
|
||||
@@ -539,6 +539,11 @@ function api(...$args)
|
||||
if ($format == 'layui-table') {
|
||||
$results['count'] = $count;
|
||||
}
|
||||
if ($format == 'data-table') {
|
||||
$results['draw'] = intval($_REQUEST['draw'] ?? 1);
|
||||
$results['recordsTotal'] = $count;
|
||||
$results['recordsFiltered'] = $count;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user