* Fix bug: batch update branch.
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user