Authored by Rock Zhang

处理个人中心优惠券返回的数据

@@ -161,7 +161,7 @@ class UserData @@ -161,7 +161,7 @@ class UserData
161 public static function couponData($uid, $status, $page = 1, $limit = 10) 161 public static function couponData($uid, $status, $page = 1, $limit = 10)
162 { 162 {
163 $param = Yohobuy::param(); 163 $param = Yohobuy::param();
164 - $param['method'] = 'app.yohocoin.lists'; 164 + $param['method'] = 'app.coupons.li';
165 $param['uid'] = $uid; 165 $param['uid'] = $uid;
166 $param['status'] = $status; 166 $param['status'] = $status;
167 $param['page'] = $page; 167 $param['page'] = $page;
@@ -167,13 +167,14 @@ class HomeController extends AbstractAction @@ -167,13 +167,14 @@ class HomeController extends AbstractAction
167 $this->setNavHeader('优惠券', true, SITE_MAIN); 167 $this->setNavHeader('优惠券', true, SITE_MAIN);
168 // $uid = $this->getUid(); 168 // $uid = $this->getUid();
169 $uid = 8826435; 169 $uid = 8826435;
170 - $status = $this->get('status', 0);  
171 $coupons = array( 170 $coupons = array(
172 - 'couponsUrl' => \Index\UserModel::getCouponData($uid, $status), 171 + 'couponsUrl' => array(
  172 + \Index\UserModel::getCouponData($uid, 0),
  173 + \Index\UserModel::getCouponData($uid, 1),
  174 + ),
173 'couponsPage' => true 175 'couponsPage' => true
174 ); 176 );
175 177
176 - print_r($coupons);  
177 $this->_view->display('coupons', $coupons); 178 $this->_view->display('coupons', $coupons);
178 179
179 } 180 }
@@ -218,7 +218,7 @@ class UserModel @@ -218,7 +218,7 @@ class UserModel
218 218
219 // 处理优惠券数据 219 // 处理优惠券数据
220 if (isset($coupons['data']) && !empty($coupons['data'])) { 220 if (isset($coupons['data']) && !empty($coupons['data'])) {
221 - $result = $coupons['data']; 221 + $result = $coupons['data']['info'];
222 } 222 }
223 223
224 return $result; 224 return $result;