调整优惠券类型
This commit is contained in:
parent
cd83ab0ccd
commit
a2e92c6a43
@ -48,6 +48,8 @@ class StoreCouponRepository extends BaseRepository
|
||||
const TYPE_STORE_ALL = 0;
|
||||
//店铺商品券
|
||||
const TYPE_STORE_PRODUCT = 1;
|
||||
//店铺现金抵扣券
|
||||
const TYPE_STORE_COUPON = 2;
|
||||
//平台券
|
||||
const TYPE_PLATFORM_ALL = 10;
|
||||
//平台分类券
|
||||
@ -56,8 +58,6 @@ class StoreCouponRepository extends BaseRepository
|
||||
const TYPE_PLATFORM_STORE = 12;
|
||||
//平台购物卡,可全额抵扣,可结余
|
||||
const TYPE_PLATFORM_CARD = 13;
|
||||
//平台抵扣券,按比例部分抵扣,可结余
|
||||
const TYPE_PLATFORM_COUPON = 14;
|
||||
|
||||
//获取方式
|
||||
const GET_COUPON_TYPE_RECEIVE = 0;
|
||||
@ -231,8 +231,9 @@ class StoreCouponRepository extends BaseRepository
|
||||
Elm::input('title', '优惠券名称:')->placeholder('请输入优惠卷名称')->required(),
|
||||
Elm::radio('type', '优惠券类型:', 0)
|
||||
->setOptions([
|
||||
['value' => 0, 'label' => '店铺券'],
|
||||
['value' => 1, 'label' => '商品券'],
|
||||
['value' => self::TYPE_STORE_ALL, 'label' => '店铺券'],
|
||||
['value' => self::TYPE_STORE_PRODUCT, 'label' => '商品券'],
|
||||
['value' => self::TYPE_STORE_COUPON, 'label' => '现金抵扣券'],
|
||||
])->control([
|
||||
[
|
||||
'value' => 1,
|
||||
@ -397,7 +398,6 @@ class StoreCouponRepository extends BaseRepository
|
||||
['value' => self::TYPE_PLATFORM_CATE, 'label' => '品类券'],
|
||||
['value' => self::TYPE_PLATFORM_STORE, 'label' => '跨店券'],
|
||||
['value' => self::TYPE_PLATFORM_CARD, 'label' => '购物卡'],
|
||||
['value' => self::TYPE_PLATFORM_COUPON, 'label' => '抵扣券'],
|
||||
])->control([
|
||||
[
|
||||
'value' => self::TYPE_PLATFORM_CATE,
|
||||
|
@ -243,7 +243,7 @@ class Coupon extends BaseController
|
||||
} else unset($data['use_start_time']);
|
||||
unset($data['range_date']);
|
||||
if ($data['is_limited'] == 0) $data['total_count'] = 0;
|
||||
if (!in_array($data['type'], [10, 11, 12, 13, 14])) {
|
||||
if (!in_array($data['type'], [10, 11, 12, 13])) {
|
||||
throw new ValidateException('请选择有效的优惠券类型');
|
||||
}
|
||||
$data['mer_id'] = $this->request->merId();
|
||||
|
@ -125,7 +125,7 @@ class Coupon extends BaseController
|
||||
} else unset($data['use_start_time']);
|
||||
unset($data['range_date']);
|
||||
if ($data['is_limited'] == 0) $data['total_count'] = 0;
|
||||
if (!in_array($data['type'], [0, 1])) {
|
||||
if (!in_array($data['type'], [0, 1, 2])) {
|
||||
throw new ValidateException('请选择有效的优惠券类型');
|
||||
}
|
||||
return $data;
|
||||
|
@ -29,7 +29,7 @@ class StoreCouponValidate extends Validate
|
||||
'use_start_time|有效期限' => 'requireIf:coupon_type,1|array|>:2',
|
||||
'sort|排序' => 'require|integer',
|
||||
'status|状态' => 'require|in:0,1',
|
||||
'type|优惠券类型' => 'require|in:0,1,10,11,12,13,14',
|
||||
'type|优惠券类型' => 'require|in:0,1,10,11,12,13',
|
||||
'product_id|商品' => 'requireIf:type,1|array|>:0',
|
||||
'send_type|类型' => 'require|in:0,1,2,3,4,5',
|
||||
'full_reduction|满赠金额' => 'requireIf:send_type,1|float|>=:0',
|
||||
|
Loading…
x
Reference in New Issue
Block a user