This commit is contained in:
2024-01-29 10:39:53 +07:00
parent 545c404fdf
commit 72170f373a
143 changed files with 20188 additions and 3 deletions

View File

@@ -1 +1,36 @@
<?php
use Hura8\Components\Product\AdminController\AProductController;
use Hura8\System\Paging;
$objAProductController = new AProductController();
//Paging setting
$numPerPage = getPageSize(15);
$conditions = [
"category" => explode("-", getRequest("category", '')),
"brand" => explode("-", getRequest("brand", '')),
"hotType" => explode("-", getRequest("hotType", '')),
"other_filter" => [getRequest("other_filter", '')],
"q" => getRequest("q", ''),
'numPerPage' => $numPerPage,
'page' => getPageId(),
'translated' => getRequestInt('translated', 0),
//... more extended filters
];
//debug_var($objAProductController->getFilterConditions());
$totalResults = $objAProductController->getTotal($conditions);
$item_list = $objAProductController->getList($conditions);
list($page_collection, $tb_page, $total_pages) = Paging::paging_template($totalResults, $numPerPage);
return [
"total" => $totalResults,
"item_list" => $item_list,
"pagination" => [
'collection' => $page_collection,
'html' => $tb_page,
'total_pages' => $total_pages,
],
];