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;
@@ -24,13 +24,13 @@ @@ -24,13 +24,13 @@
24 } 24 }
25 .boys{ 25 .boys{
26 background:resolve('shopping-cart/boys.png') bottom left repeat-x #fff; 26 background:resolve('shopping-cart/boys.png') bottom left repeat-x #fff;
27 - } 27 + }
28 .girls{ 28 .girls{
29 background:resolve('shopping-cart/girls.png') bottom left repeat-x #fff; 29 background:resolve('shopping-cart/girls.png') bottom left repeat-x #fff;
30 - } 30 + }
31 .kids{ 31 .kids{
32 background:resolve('shopping-cart/kids.png') bottom left repeat-x #fff; 32 background:resolve('shopping-cart/kids.png') bottom left repeat-x #fff;
33 - } 33 + }
34 .life-style{ 34 .life-style{
35 background:resolve('shopping-cart/lifeStyle.png') bottom left repeat-x #fff !important; 35 background:resolve('shopping-cart/lifeStyle.png') bottom left repeat-x #fff !important;
36 } 36 }
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 padding-left:40px; 51 padding-left:40px;
52 font-size: 32px; 52 font-size: 32px;
53 line-height: 82px; 53 line-height: 82px;
54 - span{ 54 + span{
55 position: absolute; 55 position: absolute;
56 right: 20px; 56 right: 20px;
57 top: 28px; 57 top: 28px;
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 width: 48%; 86 width: 48%;
87 height: 40px; 87 height: 40px;
88 font-size: 32px; 88 font-size: 32px;
89 - overflow: hidden; 89 + overflow: hidden;
90 text-overflow:ellipsis; 90 text-overflow:ellipsis;
91 white-space:nowrap; 91 white-space:nowrap;
92 } 92 }
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 color: #444; 118 color: #444;
119 &:last-child h3{ 119 &:last-child h3{
120 border-bottom:none; 120 border-bottom:none;
121 - } 121 + }
122 h3{ 122 h3{
123 width: 95%; 123 width: 95%;
124 height: 80px; 124 height: 80px;
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 p{ 133 p{
134 display: inline-block; 134 display: inline-block;
135 height: 80px; 135 height: 80px;
136 - overflow: hidden; 136 + overflow: hidden;
137 text-overflow:ellipsis; 137 text-overflow:ellipsis;
138 white-space:nowrap; 138 white-space:nowrap;
139 } 139 }
@@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@
142 margin-left: 8px; 142 margin-left: 8px;
143 height: 80px; 143 height: 80px;
144 display: inline-block; 144 display: inline-block;
145 - overflow: hidden; 145 + overflow: hidden;
146 text-overflow:ellipsis; 146 text-overflow:ellipsis;
147 white-space:nowrap; 147 white-space:nowrap;
148 } 148 }
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 height: 80px; 152 height: 80px;
153 text-align: right; 153 text-align: right;
154 font-size: 28px; 154 font-size: 28px;
155 - overflow: hidden; 155 + overflow: hidden;
156 text-overflow:ellipsis; 156 text-overflow:ellipsis;
157 white-space:nowrap; 157 white-space:nowrap;
158 } 158 }
@@ -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
@@ -118,18 +115,18 @@ class CouponController extends AbstractAction @@ -118,18 +115,18 @@ class CouponController extends AbstractAction
118 */ 115 */
119 public function isApp() 116 public function isApp()
120 { 117 {
121 - /* $userAgent = $this->getUserAgent();  
122 - if (stristr($userAgent, 'ipad')) {  
123 - return false;  
124 - }  
125 - $mobileAgents = array('iphone', 'android', "240x320", "acer", "acoon", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "anywhereyougo.com", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq", "bilbo", "bird", "blackberry", "blazer", "bleu", "cdm-", "compal", "coolpad", "danger", "dbtel", "dopod", "elaine", "eric", "etouch", "fly ", "fly_", "fly-", "go.web", "goodaccess", "gradiente", "grundig", "haier", "hedy", "hitachi", "htc", "huawei", "hutchison", "inno", "ipad", "ipaq", "ipod", "jbrowser", "kddi", "kgt", "kwc", "lenovo", "lg ", "lg2", "lg3", "lg4", "lg5", "lg7", "lg8", "lg9", "lg-", "lge-", "lge9", "longcos", "maemo", "mercator", "meridian", "micromax", "midp", "mini", "mitsu", "mmm", "mmp", "mobi", "mot-", "moto", "nec-", "netfront", "newgen", "nexian", "nf-browser", "nintendo", "nitro", "nokia", "nook", "novarra", "obigo", "palm", "panasonic", "pantech", "philips", "phone", "pg-", "playstation", "pocket", "pt-", "qc-", "qtek", "rover", "sagem", "sama", "samu", "sanyo", "samsung", "sch-", "scooter", "sec-", "sendo", "sgh-", "sharp", "siemens", "sie-", "softbank", "sony", "spice", "sprint", "spv", "symbian", "tablet", "talkabout", "tcl-", "teleca", "telit", "tianyu", "tim-", "toshiba", "tsm", "up.browser", "utec", "utstar", "verykool", "virgin", "vk-", "voda", "voxtel", "vx", "wap", "wellco", "wig browser", "wii", "windows ce", "wireless", "xda", "xde", "zte");  
126 - $isMobile = false;  
127 - foreach ($mobileAgents as $device) {  
128 - if (stristr($userAgent, $device)) {  
129 - $isMobile = true;  
130 - break;  
131 - }  
132 - }*/ 118 + /* $userAgent = $this->getUserAgent();
  119 + if (stristr($userAgent, 'ipad')) {
  120 + return false;
  121 + }
  122 + $mobileAgents = array('iphone', 'android', "240x320", "acer", "acoon", "acs-", "abacho", "ahong", "airness", "alcatel", "amoi", "anywhereyougo.com", "applewebkit/525", "applewebkit/532", "asus", "audio", "au-mic", "avantogo", "becker", "benq", "bilbo", "bird", "blackberry", "blazer", "bleu", "cdm-", "compal", "coolpad", "danger", "dbtel", "dopod", "elaine", "eric", "etouch", "fly ", "fly_", "fly-", "go.web", "goodaccess", "gradiente", "grundig", "haier", "hedy", "hitachi", "htc", "huawei", "hutchison", "inno", "ipad", "ipaq", "ipod", "jbrowser", "kddi", "kgt", "kwc", "lenovo", "lg ", "lg2", "lg3", "lg4", "lg5", "lg7", "lg8", "lg9", "lg-", "lge-", "lge9", "longcos", "maemo", "mercator", "meridian", "micromax", "midp", "mini", "mitsu", "mmm", "mmp", "mobi", "mot-", "moto", "nec-", "netfront", "newgen", "nexian", "nf-browser", "nintendo", "nitro", "nokia", "nook", "novarra", "obigo", "palm", "panasonic", "pantech", "philips", "phone", "pg-", "playstation", "pocket", "pt-", "qc-", "qtek", "rover", "sagem", "sama", "samu", "sanyo", "samsung", "sch-", "scooter", "sec-", "sendo", "sgh-", "sharp", "siemens", "sie-", "softbank", "sony", "spice", "sprint", "spv", "symbian", "tablet", "talkabout", "tcl-", "teleca", "telit", "tianyu", "tim-", "toshiba", "tsm", "up.browser", "utec", "utstar", "verykool", "virgin", "vk-", "voda", "voxtel", "vx", "wap", "wellco", "wig browser", "wii", "windows ce", "wireless", "xda", "xde", "zte");
  123 + $isMobile = false;
  124 + foreach ($mobileAgents as $device) {
  125 + if (stristr($userAgent, $device)) {
  126 + $isMobile = true;
  127 + break;
  128 + }
  129 + }*/
133 $isMobile = $this->get('app_version'); 130 $isMobile = $this->get('app_version');
134 return !empty($isMobile); 131 return !empty($isMobile);
135 } 132 }