update frontend

This commit is contained in:
Tokumeikoi 2020-02-14 18:24:59 +08:00
parent 72ac20d387
commit d356722482
4 changed files with 14 additions and 3 deletions

View File

@ -64,6 +64,7 @@ class UserController extends Controller
'banned',
'plan_id',
'commission_rate',
'discount',
'is_admin'
]);
$user = User::find($request->input('id'));

View File

@ -20,7 +20,8 @@ class UserUpdate extends FormRequest
'banned' => 'required|in:0,1',
'is_admin' => 'required|in:0,1',
'plan_id' => 'integer',
'commission_rate' => 'nullable|integer|min:0|max:100'
'commission_rate' => 'nullable|integer|min:0|max:100',
'discount' => 'nullable|integer|min:0|max:100'
];
}
@ -39,7 +40,11 @@ class UserUpdate extends FormRequest
'commission_rate.integer' => '推荐返利比例格式不正确',
'commission_rate.nullable' => '推荐返利比例格式不正确',
'commission_rate.min' => '推荐返利比例最小为0',
'commission_rate.max' => '推荐返利比例最大为100'
'commission_rate.max' => '推荐返利比例最大为100',
'discount.integer' => '专属折扣比例格式不正确',
'discount.nullable' => '专属折扣比例格式不正确',
'discount.min' => '专属折扣比例最小为0',
'discount.max' => '专属折扣比例最大为100'
];
}
}

View File

@ -18,6 +18,7 @@ CREATE TABLE `failed_jobs` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `v2_coupon`;
CREATE TABLE `v2_coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@ -209,6 +210,7 @@ CREATE TABLE `v2_user` (
`password` varchar(64) NOT NULL,
`password_algo` char(10) DEFAULT NULL,
`balance` int(11) NOT NULL DEFAULT '0',
`discount` int(11) DEFAULT NULL,
`commission_rate` int(11) DEFAULT NULL,
`commission_balance` int(11) NOT NULL DEFAULT '0',
`t` int(11) NOT NULL DEFAULT '0',
@ -236,4 +238,4 @@ CREATE TABLE `v2_user` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 2020-02-11 08:22:50
-- 2020-02-14 10:22:53

View File

@ -153,3 +153,6 @@ CREATE TABLE `failed_jobs` (
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE `v2_user`
ADD `discount` int(11) NULL AFTER `balance`;