Authored by Rock Zhang

修复优惠券有关的逻辑处理问题

... ... @@ -171,12 +171,11 @@ class UserData
* 优惠券数据
*
* @param int $uid 用户ID
* @param int $status 优惠券状态,0表示未使用,1表示已使用
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 优惠券接口返回的数据
*/
public static function couponData($uid, $status, $page = 1, $limit = 10)
public static function couponData($uid, $page = 1, $limit = 10)
{
$urlList = array();
... ...
... ... @@ -162,9 +162,8 @@ class HomeController extends AbstractAction
$this->setNavHeader('优惠券', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 8826435;
$status = $this->get('status', 0);
$coupons = array(
'couponsUrl' => \Index\UserModel::getCouponData($uid, $status),
'couponsUrl' => \Index\UserModel::getCouponData($uid),
'couponsPage' => true
);
$this->_view->display('coupons', $coupons);
... ...
... ... @@ -258,12 +258,12 @@ class UserModel
* @param int $uid 用户ID
* @return array|mixed 处理之后的优惠券数据
*/
public static function getCouponData($uid, $status)
public static function getCouponData($uid)
{
$result = array();
// 调用接口获取优惠券数据
$coupons = UserData::couponData($uid, $status);
$coupons = UserData::couponData($uid);
// 处理优惠券数据
if (!empty($coupons['unused'])) {
... ...