Commit 48c7be1d authored by liuyuzhen's avatar liuyuzhen

组合销售缓存修改相关

parent bef21b86
......@@ -192,7 +192,6 @@ class PBundlingModel extends \DAO\AbstractModel {
return false;
}
$pBundling = $result['result'];
\Our\Log::getInstance()->write(json_encode($pBundling),'/data/log/apptest');
$key = $result['key'];
if($op == \Our\ApiConst::minus){
$pBundling['bl_storage'] = $pBundling['bl_storage']-$blStorage;
......@@ -205,9 +204,7 @@ class PBundlingModel extends \DAO\AbstractModel {
$pBundling['bl_storage'] = $pBundling['bl_storage']+$blStorage;
$pBundling['bl_origin_storage'] = $pBundling['bl_origin_storage']+$blStorage;
}
\Our\Log::getInstance()->write(json_encode($pBundling),'/data/log/apptest');
\Lock\RedisLock::getInstance()->releaseLock(\Our\NameConst::pBundlingStorageRedisPrefix.$blId);
\Our\Log::getInstance()->write($key,'/data/log/apptest');
return $pBundlingRedisDao->setNoPrefix($key,serialize($pBundling),\Our\ApiConst::oneDaySecond);
}
......@@ -253,13 +250,26 @@ class PBundlingModel extends \DAO\AbstractModel {
public function deletePBundlingByBlId($blId){
$pBundlingDao = \Redis\Db4\PBundlingRedisModel::getInstance();
$pBundlingDao->tableDelAll($pBundlingDao->tableKeys('gid_'.$blId));
$isLock = \Lock\RedisLock::getInstance()->getLock(\Our\NameConst::pBundlingStorageRedisPrefix.$blId);
if(!$isLock){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::serverBusy);
}
$pBundlingRedisDao = \Redis\Db4\PBundlingRedisModel::getInstance();
$pBundlingRedisDao->tableDelAll($pBundlingRedisDao->tableKeys('gid_'.$blId));
\Business\Goods\GroupSaleServiceModel::getInstance()->getPBundlingListByBlIds(array($blId));
\Lock\RedisLock::getInstance()->releaseLock(\Our\NameConst::pBundlingStorageRedisPrefix.$blId);
return true;
}
public function deletePBundlingByGoodsCommonId($goodsCommonId){
$pBundlingDao = \Redis\Db4\PBundlingRedisModel::getInstance();
return $pBundlingDao->tableDelAll($pBundlingDao->tableKeys('*'.\Our\NameConst::blGoods.$goodsCommonId));
$blIdsStrs = $pBundlingDao->tableKeys('*'.\Our\NameConst::blGoods.$goodsCommonId);
foreach($blIdsStrs as $blIdStr){
$newstr = substr($blIdStr,strpos($blIdStr,'gid_')+4);
$blId = substr($newstr,0,(strlen($newstr)-strlen(substr($newstr,strpos($newstr,'_goodsCommon')))));
$this->deletePBundlingByBlId($blId);
}
return true;
}
/**
......
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