47 lines
1018 B
PHP
47 lines
1018 B
PHP
<?php
|
|
|
|
namespace addon\coupon\dict;
|
|
|
|
|
|
/**
|
|
* 订单公共属性
|
|
*/
|
|
class CouponDict
|
|
{
|
|
const normal = 1;
|
|
const used = 2;
|
|
const expire = 3;
|
|
const close = 4;
|
|
|
|
/**
|
|
* 优惠券状态
|
|
* @param $status
|
|
* @return string|string[]
|
|
*/
|
|
public static function getStatus($status = ''){
|
|
$list = [
|
|
self::normal => '待使用',
|
|
self::used => '已使用',
|
|
self::expire => '已过期',
|
|
self::close => '已关闭',
|
|
];
|
|
|
|
if($status) return $list[$status] ?? '';
|
|
return $list;
|
|
}
|
|
|
|
const all = 1;
|
|
const selected = 2;
|
|
const selected_out = 3;
|
|
public static function getGoodsType($type = ''){
|
|
$list = [
|
|
self::all => '全部商品参与',
|
|
self::selected => '指定商品参与',
|
|
self::selected_out => '指定不参与商品'
|
|
];
|
|
|
|
if($type) return $list[$type] ?? '';
|
|
return $list;
|
|
}
|
|
}
|