<?php
/**
 * 优惠券相关
 * User: liuyuzhen
 * Date: 2018/6/7
 * Time: 15:39
 * Description:
 */

class CouponController extends \Our\Controller_AbstractIndex{

    /**
     * 获取店铺优惠券列表
     */
    public function getStoreCouponsAction(){
        $data = $this->req[\Our\NameConst::data];
        $memberId = $this->sess->get('member_id');
        $couponService = \Business\Coupon\CouponServiceModel::getInstance();
        $couponList = $couponService->getStoreCoupons($data,$memberId);
        $this->success($couponList);
    }

    public function getGoodsCouponAction(){

    }

    public function getCouponByIdAction(){
        $data = $this->req[\Our\NameConst::data];
        $memberId = $this->sess->get('member_id');
        $couponService = \Business\Coupon\CouponServiceModel::getInstance();
        $coupon = $couponService->getCouponById($data,$memberId);
        $this->success($coupon);
    }



    public function getGoodsCouponsAction(){
        $data = $this->req[\Our\NameConst::data];
        $memberId = $this->sess->get('member_id');
        $couponService = \Business\Coupon\CouponServiceModel::getInstance();
        $couponList = $couponService->getGoodsCoupons($data,$memberId);
        $this->success($couponList);
    }

}

