* Fix bug#16051.

This commit is contained in:
xieqiyu
2021-11-08 16:37:19 +08:00
parent 784eba13ab
commit 74c1b31476
3 changed files with 6 additions and 3 deletions
+5 -1
View File
@@ -27,13 +27,17 @@ class branch extends control
{
$this->loadModel('product')->setMenu($productID);
$branchList = $this->branch->getList($productID, $browseType, $orderBy, $pager = null);
/* Load pager. */
$recTotal = count($branchList);
$this->app->loadClass('pager', $static = true);
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
$pager = new pager($recTotal, $recPerPage, $pageID);
$branchList = array_chunk($branchList, $pager->recPerPage);
$this->view->title = $this->lang->branch->manage;
$this->view->branchList = $this->branch->getList($productID, $browseType, $orderBy, $pager);
$this->view->branchList = empty($branchList) ? $branchList : $branchList[$pageID - 1];
$this->view->productID = $productID;
$this->view->browseType = $browseType;
$this->view->orderBy = $orderBy;
-1
View File
@@ -69,7 +69,6 @@ class branchModel extends model
$mainBranch->desc = $this->lang->branch->mainBranch;
$mainBranch->order = 0;
if($pager) $pager->recTotal = $pager->recTotal + 1;
return array($mainBranch) + $branchList;
}
+1 -1
View File
@@ -13,7 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2><?php echo $lang->branch->create;?></h2>
<h2><?php echo $lang->branch->editAction;?></h2>
</div>
<form class='main-form' method='post' target='hiddenwin'>
<table class='table table-form'>