Merge branch 'feature/coupon' of http://git.dev.yoho.cn/web/yohobuy into feature/coupon
Showing
1 changed file
with
43 additions
and
13 deletions
@@ -24,7 +24,7 @@ class CouponController extends AbstractAction | @@ -24,7 +24,7 @@ class CouponController extends AbstractAction | ||
24 | */ | 24 | */ |
25 | public function floorAction() | 25 | public function floorAction() |
26 | { | 26 | { |
27 | - $data = [ | 27 | + $result = [ |
28 | 'title' => '热门推荐', | 28 | 'title' => '热门推荐', |
29 | 'showTitle' => 1, | 29 | 'showTitle' => 1, |
30 | 'coupons' => [ | 30 | 'coupons' => [ |
@@ -60,9 +60,12 @@ class CouponController extends AbstractAction | @@ -60,9 +60,12 @@ class CouponController extends AbstractAction | ||
60 | ] | 60 | ] |
61 | ] | 61 | ] |
62 | ]; | 62 | ]; |
63 | + /*// 优惠券列表接口调用 | ||
64 | + $param['method'] = 'app.promotion.queryCoupon'; | ||
65 | + $result = \Api\YohobuyH5::get(\Api\YohobuyH5::SERVICE_URL,$param);*/ | ||
63 | 66 | ||
64 | $this->_view->display('index', array( | 67 | $this->_view->display('index', array( |
65 | - 'floor' => $data, | 68 | + 'floor' => $result, |
66 | 'floorPage' => true | 69 | 'floorPage' => true |
67 | )); | 70 | )); |
68 | } | 71 | } |
@@ -107,19 +110,46 @@ class CouponController extends AbstractAction | @@ -107,19 +110,46 @@ class CouponController extends AbstractAction | ||
107 | public function getCoupon($couponId) | 110 | public function getCoupon($couponId) |
108 | { | 111 | { |
109 | if ($couponId) { | 112 | if ($couponId) { |
110 | - $param['alg'] = 'SALT_MD5'; | ||
111 | - $param['code'] = 200; | ||
112 | - $param['data'] = ''; | ||
113 | - $param['md5'] = '50d19f5f5098c34607018f144baec14a'; | ||
114 | - $param['message'] = '操作成功'; | 113 | + $result['alg'] = 'SALT_MD5'; |
114 | + $result['code'] = 200; | ||
115 | + $result['data'] = ''; | ||
116 | + $result['md5'] = '50d19f5f5098c34607018f144baec14a'; | ||
117 | + $result['message'] = '操作成功'; | ||
115 | } else { | 118 | } else { |
116 | - $param['alg'] = 'SALT_MD5'; | ||
117 | - $param['code'] = 402; | ||
118 | - $param['data'] = ''; | ||
119 | - $param['md5'] = '50d19f5f5098c34607018f144baec14a'; | ||
120 | - $param['message'] = '操作失败'; | 119 | + $result['alg'] = 'SALT_MD5'; |
120 | + $result['code'] = 402; | ||
121 | + $result['data'] = ''; | ||
122 | + $result['md5'] = '50d19f5f5098c34607018f144baec14a'; | ||
123 | + $result['message'] = '操作失败'; | ||
121 | } | 124 | } |
122 | - return $param; | 125 | + |
126 | + /*// 判断用户是否登录 | ||
127 | + if (!$this->getUid() || !is_numeric($this->getUid())) { | ||
128 | + // 用户未登录,跳转登录页面 | ||
129 | + if ($this->isApp()) { | ||
130 | + $this->go(Helpers::url('/signin.html', array('refer' => Helpers::url($_SERVER["REQUEST_URI"])), 'default')); | ||
131 | + } else { | ||
132 | + $this->go($_SERVER["REQUEST_URI"] . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . strtr($_SERVER["REQUEST_URI"], array('/' => '\\/')) . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}'); | ||
133 | + } | ||
134 | + } | ||
135 | + | ||
136 | + // 组合接口参数 | ||
137 | + $params['method'] = 'app.promotion.getCoupon'; | ||
138 | + $params['couponId'] = $couponId; | ||
139 | + $params['uid'] = $this->getUid(); | ||
140 | + | ||
141 | + $result = \Api\YohobuyH5::get(\Api\YohobuyH5::SERVICE_URL, $params);*/ | ||
142 | + | ||
143 | + return $result; | ||
123 | } | 144 | } |
124 | 145 | ||
146 | + /** | ||
147 | + * 判断是否是 APP | ||
148 | + * | ||
149 | + * @return bool | ||
150 | + */ | ||
151 | + public function isApp() | ||
152 | + { | ||
153 | + return (null !== $this->get('app_version')); | ||
154 | + } | ||
125 | } | 155 | } |
-
Please register or login to post a comment