Commit 8b494e0e authored by liuyuzhen's avatar liuyuzhen

缓存问题

parent 8d18fbb5
...@@ -240,7 +240,12 @@ class GoodsModel extends \DAO\AbstractModel { ...@@ -240,7 +240,12 @@ class GoodsModel extends \DAO\AbstractModel {
if($op==\Our\ApiConst::plus){ if($op==\Our\ApiConst::plus){
$updateGoodsNum = -$updateGoodsNum; $updateGoodsNum = -$updateGoodsNum;
} }
if($goodsCommonRedis->tableHExists($onlineGoodsCommonSaleNumKey,$goodsCommonId)){ if($goodsCommonRedis->tableHExists($onlineGoodsCommonSaleNumKey,$goodsCommonId)){
$oldSaleNum = $goodsCommonRedis->tableHGet($onlineGoodsCommonSaleNumKey,$goodsCommonId);
if($oldSaleNum-$updateGoodsNum<\Our\ApiConst::zero){
$updateGoodsNum = \Our\ApiConst::zero;
}
$goodsCommonRedis->tableHIncrBy($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum); $goodsCommonRedis->tableHIncrBy($onlineGoodsCommonSaleNumKey,$goodsCommonId,$updateGoodsNum);
} }
} }
......
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