c
This commit is contained in:
@@ -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,
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user