Commit 10a09617 authored by liuyuzhen's avatar liuyuzhen

Merge branch 'lyz' of git.shenbd.com:qm-develop/shenbd into lyz_version1

parents 406b4311 2a5d1e5e
......@@ -933,7 +933,7 @@ class OrderConfirmUtil {
if($blGoodsList){
$dbName = \Our\DbNameConst::masterDBConnectName;
$pBundlingDao = \DAO\PBundlingModel::getInstance($dbName);
$pBundlingResult = $pBundlingDao->updateBlStorage($blGoodsList);
$pBundlingResult = $pBundlingDao->updateBlStorage($blGoodsList,$op);
if(!$pBundlingResult){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::blGoodsStorageToDBFailedForOrder);
}
......@@ -970,7 +970,7 @@ class OrderConfirmUtil {
$goodsDao = \DAO\GoodsModel::getInstance();
if($blGoodsList){
foreach($blGoodsList as $key=>$blGoods){
$pBundlingCacheResult = $pBundlingDao->opBlGoodsStorage($key,$blGoods['blStorage']);//组合销售库存删减
$pBundlingCacheResult = $pBundlingDao->opBlGoodsStorage($key,$blGoods['blStorage'],$op);//组合销售库存删减
if($pBundlingCacheResult===false){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::blGoodsStorageToCacheFailedForOrder);
}
......
......@@ -125,7 +125,7 @@ class PBundlingModel extends \DAO\AbstractModel {
return $result;
}
public function updateBlStorage($dataList){
public function updateBlStorage($dataList,$op = \Our\ApiConst::minus){
$datas = array_values($dataList);
$this->setDb(\Our\DbNameConst::masterDBConnectName);
$error = 0;
......@@ -133,7 +133,7 @@ class PBundlingModel extends \DAO\AbstractModel {
$updateAllSql = $baseSql;
$dataIds = array();
for ($i = 0; $i < count($datas); $i++) {
$updateSql = \Our\Common::format(" WHEN {0} THEN bl_storage-{1} ", $datas[$i]['blId'], $datas[$i]['blStorage']);
$updateSql = \Our\Common::format(" WHEN {0} THEN bl_storage{2}{1} ", $datas[$i]['blId'], $datas[$i]['blStorage'],\Our\ArrayConst::ops[$op]);
$dataIds[] = $datas[$i]['blId'];
$updateAllSql .= $updateSql;
if ($i % 1000 == 0 && $i != 0) {
......
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