Commit df234ec7 authored by liuyuzhen's avatar liuyuzhen

购物车下单是删除购物车缓存

parent 0356bcb4
......@@ -41,6 +41,8 @@ class OrderConfirmUtil {
private $storeMemos = array();
private $cartCacheDeleteFlag = false;
public function addOrder($data,$memberId,$currentAddress){
$storeCartData = $this->checkPostData($data,$memberId,$currentAddress);
//return $storeCartData;
......@@ -89,6 +91,7 @@ class OrderConfirmUtil {
$this->storeIds= array_keys($cartList['list']);
$this->storeMemos[$this->postData['storeId']] = isset($this->postData['storeMemo'])?$this->postData['storeMemo']:\Our\NameConst::emptyString;
}else{
$this->cartCacheDeleteFlag = true;
foreach($this->postData as $temp){
$this->checkOneStoreData($temp);
if(!$temp['cartIds']){
......@@ -513,10 +516,23 @@ class OrderConfirmUtil {
}
public function opCacheInfo(){
if($this->cartCacheDeleteFlag){
$this->delCartCache();
}
$this->deleteCacheInfo();
$this->pushSaleGoods();
}
public function delCartCache(){
$cartRedis = \Redis\Db7\CartRedisModel::getInstance();
$memberCartKey = \Our\NameConst::memberCartStorePrefix.$this->memberId;
$cartRedis->tableDel($memberCartKey);
foreach($this->storeIds as $tempStoreId){
$memberStoreCartsKey = \Our\NameConst::memberStoreCartsPrefix.$this->memberId.\Our\NameConst::underline.$tempStoreId;
$cartRedis->tableDel($memberStoreCartsKey);
}
}
public function pushSaleGoods(){
if($this->saleGoodsIds){
$saleGoodsDao = \DAO\SaleGoodsModel::getInstance();
......
......@@ -157,8 +157,8 @@ class AdvServiceModel extends \Business\AbstractModel{
$advMobileSql = \Our\Common::format($advMobileSql,$where['storeId'],$position,\Our\ApiConst::one,\Our\ApiConst::one);
$advMobileField = 'href,src,end_time,start_time';
$advMobileList = \Our\RedisHelper::cachedFunction(\Redis\Db9\AdvMobileRedisModel::getInstance(),array(&$advMobileDao, 'getList'),array($advMobileSql,$advMobileField,array('adv_id'=>\Our\NameConst::desc)),\Our\ApiConst::oneHour,array($where['storeId']));
$advs = array();
if($advMobileList){
$advs = array();
foreach($advMobileList as $adv){
if($adv['start_time']<=TIMESTAMP&&$adv['end_time']>TIMESTAMP){
$temp = array();
......@@ -167,7 +167,7 @@ class AdvServiceModel extends \Business\AbstractModel{
$advs[] = $temp;
}
}
}else{
}/*else{
$storeAdvPositionDao = \DAO\Adv\StoreAdvPositionModel::getInstance();
$storeAdvPosition = \Our\RedisHelper::cachedFunction(\Redis\Db9\StoreAdvPositionRedisModel::getInstance(),array(&$storeAdvPositionDao, 'find'),array(array('ap_id'=>$position)),\Our\ApiConst::oneHour,array($position));
if($storeAdvPosition&&$storeAdvPosition['default_content']){
......@@ -176,7 +176,7 @@ class AdvServiceModel extends \Business\AbstractModel{
}else{
$advs = array();
}
}
}*/
return $advs;
}
......
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