Authored by Rock Zhang

更新新势力领券活动有关逻辑

@@ -12,21 +12,20 @@ class XinshiliController extends HuodongAction @@ -12,21 +12,20 @@ class XinshiliController extends HuodongAction
12 // const STATIC_FILE = 'http://localhost:2222/1.0.3'; 12 // const STATIC_FILE = 'http://localhost:2222/1.0.3';
13 const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili/1.0.3'; 13 const STATIC_FILE = 'http://cdn.yoho.cn/huodong/2016xinshili/1.0.3';
14 14
  15 + private $_uid;
  16 +
15 17
16 /** 18 /**
17 * 检测登录状态 19 * 检测登录状态
18 * 20 *
19 - * @return int  
20 */ 21 */
21 private function getLoggedUid() 22 private function getLoggedUid()
22 { 23 {
23 if ($this->_isApp) { 24 if ($this->_isApp) {
24 - $uid = $this->get('uid'); 25 + $this->_uid = $this->get('uid');
25 } else { 26 } else {
26 - $uid = $this->getUid(); 27 + $this->_uid = $this->getUid();
27 } 28 }
28 -  
29 - return $uid;  
30 } 29 }
31 30
32 /** 31 /**
@@ -36,8 +35,8 @@ class XinshiliController extends HuodongAction @@ -36,8 +35,8 @@ class XinshiliController extends HuodongAction
36 { 35 {
37 $playUrl = Helpers::url('/cuxiao/xinshili/index'); 36 $playUrl = Helpers::url('/cuxiao/xinshili/index');
38 37
39 - $uid = $this->getLoggedUid();  
40 - if (!$uid) { 38 + $this->getLoggedUid();
  39 + if (!$this->_uid) {
41 if (!$this->_isApp) { 40 if (!$this->_isApp) {
42 $this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default')); 41 $this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
43 } else { 42 } else {
@@ -90,8 +89,7 @@ class XinshiliController extends HuodongAction @@ -90,8 +89,7 @@ class XinshiliController extends HuodongAction
90 } 89 }
91 90
92 $activityId = $this->getActivityId(); 91 $activityId = $this->getActivityId();
93 - $uid = $this->getLoggedUid();  
94 - $result = XinshiliModel::getXinshiliCoupon($uid, $activityId); 92 + $result = XinshiliModel::getXinshiliCoupon($this->_uid, $activityId);
95 } while (false); 93 } while (false);
96 94
97 $this->echoJson($result); 95 $this->echoJson($result);