* Fix bug: batch update branch.

This commit is contained in:
xieqiyu
2021-12-24 13:45:05 +08:00
parent a28772a3f6
commit 1491db714d
+1 -2
View File
@@ -240,7 +240,7 @@ class branchModel extends model
public function batchUpdate($productID)
{
$data = fixer::input('post')->get();
$oldBranchList = $this->getList($productID, 'all');
$oldBranchList = $this->getList($productID, 0, 'all');
$branchIDList = array_keys($this->post->IDList);
$this->app->loadLang('product');
@@ -265,7 +265,6 @@ class branchModel extends model
$branch->default = (isset($data->default) and $branchID == $data->default) ? 1 : 0;
$branch->closedDate = $branch->status == 'closed' ? helper::today() : '';
$this->dao->update(TABLE_BRANCH)->data($branch)
->batchCheck($this->config->branch->create->requiredFields, 'notempty')
->checkIF(!empty($branch->name) and $branch->name != $oldBranchList[$branchID]->name, 'name', 'unique', "product = $productID")