Commit b2f7916c authored by christ's avatar christ

ccw

parent ae07efad
......@@ -5,6 +5,7 @@ namespace Business\Goods;
use Our\ApiConst;
use Our\Common;
use Our\DbNameConst;
use Zend\Json\Server\Exception\ErrorException;
class GoodsCommonServiceModel extends \Business\AbstractModel
......@@ -29,7 +30,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if($goodsId === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
}
$goodsDao=\DAO\GoodsModel::getInstance();
$goodsDao=\DAO\GoodsModel::getInstance(DbNameConst::masterDBConnectName);
$commonDao = \DAO\GoodsCommonModel::getInstance();
$where = array();
$where['store_id'] = $storeId;
......@@ -39,6 +40,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
\Error\ErrorModel::throwException(\Error\CodeConfigModel::goodsNotExist);
}
$op = isset($this->setStorageType[$type]) ? $this->setStorageType[$type] : 1; //默认增加库存
$goodsDao->setDb($goodsDao->dbName);
$goodsDao->db->doTransaction();
$ret1 = $goodsDao->updateStorage($goodsId, $num, $op);
$ret2 = $commonDao->updateStorage($data['goods_commonid'], $op);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment