Files
admin_hura_8/data/product/home.php
2024-01-29 10:39:53 +07:00

37 lines
1.2 KiB
PHP

<?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,
],
];