<?php
/**
 * User: liuyuzhen
 * Date: 2018/8/3
 * Time: 15:57
 * Description:
 */

class MembercouponController extends \Our\Controller_AbstractApi {


    /**
     * 获取我的优惠券
     */
    public function getMyCouponsAction(){
        $data = $this->req[\Our\NameConst::data];
        $memberId = $this->memberId;
        $couponService = \Business\Coupon\CouponServiceModel::getInstance();
        $couponList = $couponService->getMyCoupons($data,$memberId);
        $this->success($couponList);
    }

    /**
     * 领取优惠券
     */
    public function receiveCouponAction(){
        $data = $this->req[\Our\NameConst::data];
        $memberId = $this->memberId;
        $couponService = \Business\Coupon\CouponServiceModel::getInstance();
        $couponService->receiveCoupon($data,$memberId);
        $this->success(new stdClass(),\Our\DescribeConst::receiveCouponSuccess,\Our\DescribeConst::receiveCouponSuccess);
    }
}