improve torrent approval

This commit is contained in:
xiaomlove
2022-08-16 18:31:04 +08:00
parent bda12cce03
commit b398c8db3c
21 changed files with 418 additions and 75 deletions

View File

@@ -516,13 +516,30 @@ function api(...$args)
$data = $data['data'];
}
}
return [
'ret' => (int)$ret,
'msg' => (string)$msg,
$time = (float)number_format(microtime(true) - nexus()->getStartTimestamp(), 3);
$count = null;
$resultKey = 'ret';
$msgKey = 'msg';
$format = $_REQUEST['__format'] ?? '';
if ($format == 'layui-table') {
$resultKey = 'code';
$count = $data['meta']['total'] ?? 0;
if (isset($data['data'])) {
$data = $data['data'];
}
}
$results = [
$resultKey => (int)$ret,
$msgKey => (string)$msg,
'data' => $data,
'time' => (float)number_format(microtime(true) - nexus()->getStartTimestamp(), 3),
'time' => $time,
'rid' => nexus()->getRequestId(),
];
if ($format == 'layui-table') {
$results['count'] = $count;
}
return $results;
}
function success(...$args)