* Add a function to activate a product.

This commit is contained in:
liugang
2022-10-08 15:33:59 +08:00
parent 65e0211cc8
commit f0aec63a7c
+19
View File
@@ -893,6 +893,25 @@ class productModel extends model
if(!dao::isError()) return common::createChanges($oldProduct, $product);
}
/**
* Activate a product.
*
* @param int $productID.
* @access public
* @return bool | array
*/
public function activate($productID)
{
$oldProduct = $this->getById($productID);
$product = (object)array('status' => 'normal');
$this->dao->update(TABLE_PRODUCT)->data($product)->where('id')->eq((int)$productID)->exec();
if(dao::isError()) return false;
return common::createChanges($oldProduct, $product);
}
/**
* Manage line.
*