use data-table instead lay-table

This commit is contained in:
xiaomlove
2022-09-08 19:14:01 +08:00
parent bbc4d72ea6
commit 7434fb5252
9 changed files with 348 additions and 7 deletions

View File

@@ -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;
}