From 34e71ff0494c09a105ba8433d7ecf7446c71d172 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 1 Jan 2020 01:50:05 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/CouponController.php | 3 ++- app/Http/Requests/Admin/CouponSave.php | 9 ++++++--- update.sql | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Admin/CouponController.php b/app/Http/Controllers/Admin/CouponController.php index 74234eba..81fbfe00 100644 --- a/app/Http/Controllers/Admin/CouponController.php +++ b/app/Http/Controllers/Admin/CouponController.php @@ -21,7 +21,8 @@ class CouponController extends Controller 'name', 'type', 'value', - 'expired_at', + 'started_at', + 'ended_at', 'limit_use' ]); diff --git a/app/Http/Requests/Admin/CouponSave.php b/app/Http/Requests/Admin/CouponSave.php index 29f7f7d7..ed2b813f 100644 --- a/app/Http/Requests/Admin/CouponSave.php +++ b/app/Http/Requests/Admin/CouponSave.php @@ -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' => '使用次数格式有误' ]; } diff --git a/update.sql b/update.sql index 9ff6b37c..268907c1 100644 --- a/update.sql +++ b/update.sql @@ -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, ); \ No newline at end of file