Updated TheTool Frontend Framework & Table
This commit is contained in:
@@ -54,19 +54,22 @@ class HistoricTicketController extends mfBaseController {
|
||||
$json = json_decode(file_get_contents('php://input'), true);
|
||||
|
||||
$filters = $json['filters'] ?? [];
|
||||
$order = $json['order'] ?? [];
|
||||
$page = $json['pagination']['page'] ?? 1;
|
||||
$perPage = $json['pagination']['per_page'] ?? 10;
|
||||
|
||||
$historicTickets = HistoricTicketModel::getAllHistoricTickets($filters, $perPage, ($page - 1) * $perPage);
|
||||
$total = HistoricTicketModel::countHistoricTickets($filters);
|
||||
$historicTickets = HistoricTicketModel::getAllHistoricTickets($filters, $perPage, ($page - 1) * $perPage, $order);
|
||||
$filtered_available = HistoricTicketModel::countHistoricTickets($filters);
|
||||
$totalRows = HistoricTicketModel::countHistoricTickets([]);
|
||||
|
||||
return [
|
||||
"rows" => $historicTickets,
|
||||
"pagination" => [
|
||||
"page" => $page,
|
||||
"total_pages" => ceil($total / $perPage),
|
||||
"total_pages" => ceil($totalRows / $perPage),
|
||||
"per_page" => $perPage,
|
||||
"total_rows" => intval($total)
|
||||
"filtered_available" => intval($filtered_available),
|
||||
"total_rows" => intval($totalRows)
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -88,16 +91,6 @@ class HistoricTicketController extends mfBaseController {
|
||||
];
|
||||
}
|
||||
|
||||
$rows = HistoricTicketModel::findTicket($query);
|
||||
|
||||
return [
|
||||
"rows" => $rows,
|
||||
"pagination" => [
|
||||
"page" => 1,
|
||||
"total_pages" => 1,
|
||||
"per_page" => count($rows),
|
||||
"total_rows" => count($rows)
|
||||
]
|
||||
];
|
||||
return HistoricTicketModel::findTicket($query);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user