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