* Fix bug 16302

This commit is contained in:
lizhiqiang
2021-11-17 11:09:25 +08:00
parent e8af2d25bc
commit 2dcd335698
+3 -2
View File
@@ -875,14 +875,15 @@ class productModel extends model
}
$this->config->product->search['params']['module']['values'] = $module;
if($this->session->currentProductType == 'normal' or $this->app->tab == 'assetlib')
$productInfo = $this->getById($productID);
if(!$productID or ($productID and $productInfo->type == 'normal') or $this->app->tab == 'assetlib')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['fields']['branch'] = $this->lang->product->branch;
$this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]);
$this->config->product->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, 'noempty') + array('all' => $this->lang->branch->all);
}