Authored by 王水玲

coupon bug 修改

@@ -75,7 +75,7 @@ class Cache @@ -75,7 +75,7 @@ class Cache
75 // 当接口异常,一级缓存没取到数据的情况 75 // 当接口异常,一级缓存没取到数据的情况
76 if ($node === 'slave') { 76 if ($node === 'slave') {
77 $incrementKey = self::makeKey('_increment_' . $key, 'slave'); 77 $incrementKey = self::makeKey('_increment_' . $key, 'slave');
78 - $incrementValue = HoodCache::Memcached('slave')->get($incrementKey); 78 + $incrementValue = intval(HoodCache::Memcached('slave')->get($incrementKey));
79 // 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0 79 // 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0
80 if (is_int($incrementValue) && $incrementValue > 5) { 80 if (is_int($incrementValue) && $incrementValue > 5) {
81 HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300); 81 HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300);
@@ -39,7 +39,7 @@ class CouponFloorProcess @@ -39,7 +39,7 @@ class CouponFloorProcess
39 foreach ($data as $k => &$v) { 39 foreach ($data as $k => &$v) {
40 $fun = ''; 40 $fun = '';
41 if (empty($v) || !is_array($v) || !array_key_exists('template_name', $v)) { 41 if (empty($v) || !is_array($v) || !array_key_exists('template_name', $v)) {
42 - if (array_key_exists('templateName', $v)) { 42 + if (isset($v['templateName'])) {
43 $fun = $v['templateName']; 43 $fun = $v['templateName'];
44 } else { 44 } else {
45 continue; 45 continue;
@@ -371,7 +371,7 @@ @@ -371,7 +371,7 @@
371 371
372 .coupon-count { 372 .coupon-count {
373 padding: 5px 15px; 373 padding: 5px 15px;
374 - background: #f00; 374 + background: #d0021b;
375 color: #fff; 375 color: #fff;
376 border-radius: 10px; 376 border-radius: 10px;
377 margin-left: 20px; 377 margin-left: 20px;
@@ -22,12 +22,9 @@ class CouponController extends AbstractAction @@ -22,12 +22,9 @@ class CouponController extends AbstractAction
22 */ 22 */
23 public function floorAction() 23 public function floorAction()
24 { 24 {
25 -  
26 - if (!$this->isApp()) {  
27 - $this->setNavHeader('领券中心', true, SITE_MAIN);  
28 - }  
29 $receiveData = filter_input_array(INPUT_GET, array( 25 $receiveData = filter_input_array(INPUT_GET, array(
30 - 'code' => FILTER_DEFAULT 26 + 'code' => FILTER_DEFAULT,
  27 + 'title' => FILTER_DEFAULT,
31 )); 28 ));
32 $result = array(); 29 $result = array();
33 $uid = ''; 30 $uid = '';
@@ -39,17 +36,17 @@ class CouponController extends AbstractAction @@ -39,17 +36,17 @@ class CouponController extends AbstractAction
39 $resource = CouponData::getCouponRousource($receiveData['code'], $uid); 36 $resource = CouponData::getCouponRousource($receiveData['code'], $uid);
40 if (isset($resource['code']) && $resource['code'] === 200) { 37 if (isset($resource['code']) && $resource['code'] === 200) {
41 $result = CouponFloorProcess::getContent($resource['data']); 38 $result = CouponFloorProcess::getContent($resource['data']);
42 - }else{  
43 - $this->_view->display('index', array(  
44 - 'content' => array(  
45 - 'noData' => true,  
46 - ),  
47 - 'floorPage' => true  
48 - )); 39 + } else {
  40 + $result['noData'] = true;
49 } 41 }
50 // 分享 42 // 分享
51 $shareData = CouponFloorProcess::getShare($receiveData['code'], '领券中心'); 43 $shareData = CouponFloorProcess::getShare($receiveData['code'], '领券中心');
52 $result[count($result)] = $shareData; 44 $result[count($result)] = $shareData;
  45 + if (!$this->isApp()) {
  46 + $this->setNavHeader($receiveData['title'], true, SITE_MAIN);
  47 + } else {
  48 + $this->setTitle($receiveData['title']);
  49 + }
53 $this->_view->display('index', array( 50 $this->_view->display('index', array(
54 'content' => $result, 51 'content' => $result,
55 'floorPage' => true 52 'floorPage' => true