Authored by 王水玲

coupon bug 修改

... ... @@ -75,7 +75,7 @@ class Cache
// 当接口异常,一级缓存没取到数据的情况
if ($node === 'slave') {
$incrementKey = self::makeKey('_increment_' . $key, 'slave');
$incrementValue = HoodCache::Memcached('slave')->get($incrementKey);
$incrementValue = intval(HoodCache::Memcached('slave')->get($incrementKey));
// 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0
if (is_int($incrementValue) && $incrementValue > 5) {
HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300);
... ...
... ... @@ -39,7 +39,7 @@ class CouponFloorProcess
foreach ($data as $k => &$v) {
$fun = '';
if (empty($v) || !is_array($v) || !array_key_exists('template_name', $v)) {
if (array_key_exists('templateName', $v)) {
if (isset($v['templateName'])) {
$fun = $v['templateName'];
} else {
continue;
... ...
... ... @@ -371,7 +371,7 @@
.coupon-count {
padding: 5px 15px;
background: #f00;
background: #d0021b;
color: #fff;
border-radius: 10px;
margin-left: 20px;
... ...
... ... @@ -22,12 +22,9 @@ class CouponController extends AbstractAction
*/
public function floorAction()
{
if (!$this->isApp()) {
$this->setNavHeader('领券中心', true, SITE_MAIN);
}
$receiveData = filter_input_array(INPUT_GET, array(
'code' => FILTER_DEFAULT
'code' => FILTER_DEFAULT,
'title' => FILTER_DEFAULT,
));
$result = array();
$uid = '';
... ... @@ -39,17 +36,17 @@ class CouponController extends AbstractAction
$resource = CouponData::getCouponRousource($receiveData['code'], $uid);
if (isset($resource['code']) && $resource['code'] === 200) {
$result = CouponFloorProcess::getContent($resource['data']);
}else{
$this->_view->display('index', array(
'content' => array(
'noData' => true,
),
'floorPage' => true
));
} else {
$result['noData'] = true;
}
// 分享
$shareData = CouponFloorProcess::getShare($receiveData['code'], '领券中心');
$result[count($result)] = $shareData;
if (!$this->isApp()) {
$this->setNavHeader($receiveData['title'], true, SITE_MAIN);
} else {
$this->setTitle($receiveData['title']);
}
$this->_view->display('index', array(
'content' => $result,
'floorPage' => true
... ...