This commit is contained in:
root 2020-01-01 01:50:05 +08:00
parent 63c1faba5e
commit 34e71ff049
3 changed files with 12 additions and 8 deletions

View File

@ -21,7 +21,8 @@ class CouponController extends Controller
'name',
'type',
'value',
'expired_at',
'started_at',
'ended_at',
'limit_use'
]);

View File

@ -17,7 +17,8 @@ class CouponSave extends FormRequest
'name' => 'required',
'type' => 'required|in:1,2',
'value' => 'required|integer',
'expired_at' => 'required|integer',
'started_at' => 'required|integer',
'ended_at' => 'required|integer',
'limit_use' => 'nullable|integer'
];
}
@ -30,8 +31,10 @@ class CouponSave extends FormRequest
'type.in' => '类型格式有误',
'value.required' => '金额或比例不能为空',
'value.integer' => '金额或比例格式有误',
'expired_at.required' => '过期时间不能为空',
'expired_at.integer' => '过期时间格式有误',
'started_at.required' => '开始时间不能为空',
'started_at.integer' => '开始时间格式有误',
'ended_at.required' => '结束时间不能为空',
'ended_at.integer' => '结束时间格式有误',
'limit_use.integer' => '使用次数格式有误'
];
}

View File

@ -95,11 +95,11 @@ CREATE TABLE `v2_coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`code` char(32) NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
`type` tinyint(1) NOT NULL COMMENT '1按比例2',
`type` tinyint(1) NOT NULL,
`value` int(11) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0',
`limit_use` int(11) DEFAULT NULL,
`expired_at` int(11) NOT NULL,
`started_at` int(11) NOT NULL,
`ended_at` int(11) NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL
`updated_at` int(11) NOT NULL,
);