* Perfect details.
This commit is contained in:
@@ -307,7 +307,7 @@ class branch extends control
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return object
|
||||
*/
|
||||
public function mergeBranch($productID)
|
||||
{
|
||||
@@ -324,8 +324,8 @@ class branch extends control
|
||||
|
||||
$this->loadModel('action')->create('branch', $targetBranch, 'MergedBranch', '', implode(',', $mergedBranches));
|
||||
|
||||
if(dao::isError()) $this->send(array('message' => dao::getError(), 'result' => 'fail'));
|
||||
if(dao::isError()) return $this->send(array('message' => dao::getError(), 'result' => 'fail'));
|
||||
|
||||
$this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success'));
|
||||
return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,12 +164,11 @@ class branchModel extends model
|
||||
*/
|
||||
public function create($productID, $withMerge = false)
|
||||
{
|
||||
$removedFields = $withMerge ? 'createBranch,mergedBranchIDList,targetBranch' : '';
|
||||
$branch = fixer::input('post')
|
||||
->add('product', $productID)
|
||||
->add('createdDate', helper::today())
|
||||
->add('status', 'active')
|
||||
->remove($removedFields)
|
||||
->removeIF($withMerge, 'createBranch,mergedBranchIDList,targetBranch')
|
||||
->get();
|
||||
|
||||
$lastOrder = (int)$this->dao->select('`order`')->from(TABLE_BRANCH)->where('product')->eq($productID)->orderBy('order_desc')->limit(1)->fetch('order');
|
||||
|
||||
Reference in New Issue
Block a user