Commit 6f9c8c46 authored by liuyuzhen's avatar liuyuzhen

优惠券为空问题吊证

parent b817946e
...@@ -113,8 +113,7 @@ class StoreController extends \Our\Controller_AbstractIndex { ...@@ -113,8 +113,7 @@ class StoreController extends \Our\Controller_AbstractIndex {
$data = $this->req[\Our\NameConst::data]; $data = $this->req[\Our\NameConst::data];
$couponService = \Business\Coupon\CouponServiceModel::getInstance(); $couponService = \Business\Coupon\CouponServiceModel::getInstance();
$couponTitles = $couponService->getStorePromotionCouponTitles($data); $couponTitles = $couponService->getStorePromotionCouponTitles($data);
$couponTitles=!empty($couponTitles)?$couponTitles:array(); $this->success($couponTitles);
$this->success($couponTitles);
} }
} }
\ No newline at end of file
...@@ -269,7 +269,7 @@ class CouponServiceModel extends \Business\AbstractModel{ ...@@ -269,7 +269,7 @@ class CouponServiceModel extends \Business\AbstractModel{
$this->validCouponStore($where); $this->validCouponStore($where);
$couponDao = \DAO\Coupon\CouponModel::getInstance(); $couponDao = \DAO\Coupon\CouponModel::getInstance();
$couponTitles = \Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$couponDao, 'getStorePromotionCouponList'),array($where['storeId']),\Our\ApiConst::oneHour,array($where['storeId'])); $couponTitles = \Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$couponDao, 'getStorePromotionCouponList'),array($where['storeId']),\Our\ApiConst::oneHour,array($where['storeId']));
return $couponTitles; return $couponTitles?$couponTitles:array();
} }
/** /**
...@@ -281,6 +281,8 @@ class CouponServiceModel extends \Business\AbstractModel{ ...@@ -281,6 +281,8 @@ class CouponServiceModel extends \Business\AbstractModel{
$couponList = \Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$this, 'getStoreCouponsById'),array($where['storeId'],$memberId),\Our\ApiConst::oneHour,array($where['storeId']."_".$memberId)); $couponList = \Our\RedisHelper::cachedFunction(\Redis\Db13\CouponRedisModel::getInstance(), array(&$this, 'getStoreCouponsById'),array($where['storeId'],$memberId),\Our\ApiConst::oneHour,array($where['storeId']."_".$memberId));
if($couponList){ if($couponList){
$couponList = array_values($couponList); $couponList = array_values($couponList);
}else{
$couponList = array();
} }
return $couponList; return $couponList;
} }
......
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