| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | <?php// +----------------------------------------------------------------------// | Niucloud-admin 企业快速开发的多应用管理平台// +----------------------------------------------------------------------// | 官方网址:https://www.niucloud.com// +----------------------------------------------------------------------// | niucloud团队 版权所有 开源版本可自由商用// +----------------------------------------------------------------------// | Author: Niucloud Team// +----------------------------------------------------------------------namespace addon\mall\app\dict\coupon;class CouponDict{    //未开始    const WAIT_START = 0;    //进行中    const NORMAL = 1;    //已过期    const EXPIRE = 2;    //已失效    const INVALID = 3;    //通用券    const ALL = 1;    //店铺品类券    const CATEGORY = 2;    //商品券    const GOODS = 3;    //品牌券    const BRAND = 4;    //平台品类券    const MALL_CATEGORY = 5;    const USER = 1;    const GRANT = 2;    //所有店铺参与    const ALL_SITE_JOIN = 0;    //指定店铺参与    const NOT_ALL_SITE_JOIN = 1;    /**     * 优惠券类型     * @param string $type     * @return array|mixed|string     */    public static function getType($type = ''){        $list = [            self::ALL => get_lang('dict_mall_coupon.all'),            self::CATEGORY => get_lang('dict_mall_coupon.category'),            self::GOODS => get_lang('dict_mall_coupon.goods'),            self::BRAND => get_lang('dict_mall_coupon.brand'),            self::MALL_CATEGORY => get_lang('dict_mall_coupon.category'),        ];        if ($type == '') return $list;        return $list[$type] ?? '';    }    /**     * 领取优惠券类型     * @param string $type     * @return array|mixed|string     */    public static function getReceiveType($type = ''){        $list = [            self::USER => get_lang('dict_mall_coupon.user'),            self::GRANT => get_lang('dict_mall_coupon.grant'),        ];        if ($type == '') return $list;        return $list[$type] ?? '';    }    /**     * 优惠券活动状态     * @param $status     * @return array|mixed|string     */    public static function getStatus($status = ''){        $list = [            self::WAIT_START => get_lang('dict_mall_coupon.wait_start'),            self::NORMAL => get_lang('dict_mall_coupon.normal'),            self::EXPIRE => get_lang('dict_mall_coupon.expire'),            self::INVALID => get_lang('dict_mall_coupon.invalid'),        ];        if ($status == '') return $list;        return $list[$status] ?? '';    }}
 |