diff --git a/app/Http/Requests/Admin/PlanSave.php b/app/Http/Requests/Admin/PlanSave.php index 30fb29a6..bca58cd2 100755 --- a/app/Http/Requests/Admin/PlanSave.php +++ b/app/Http/Requests/Admin/PlanSave.php @@ -10,11 +10,13 @@ class PlanSave extends FormRequest 'name' => 'required', 'content' => '', 'group_id' => 'required', + 'type' => 'required|in:0,1', 'transfer_enable' => 'required', 'month_price' => 'nullable|integer', 'quarter_price' => 'nullable|integer', 'half_year_price' => 'nullable|integer', - 'year_price' => 'nullable|integer' + 'year_price' => 'nullable|integer', + 'onetime_price' => 'nullable|integer' ]; /** * Get the validation rules that apply to the request. @@ -30,12 +32,15 @@ class PlanSave extends FormRequest { return [ 'name.required' => '套餐名称不能为空', + 'type.required' => '套餐类型不能为空', + 'type.in' => '套餐类型格式有误', 'group_id.required' => '权限组不能为空', 'transfer_enable.required' => '流量不能为空', 'month_price.integer' => '月付金额格式有误', 'quarter_price.integer' => '季付金额格式有误', 'half_year_price.integer' => '半年付金额格式有误', - 'year_price.integer' => '年付金额格式有误' + 'year_price.integer' => '年付金额格式有误', + 'onetime_price.integer' => '一次性金额有误' ]; } } diff --git a/config/app.php b/config/app.php index 8cc80a9f..9f4e4c5f 100755 --- a/config/app.php +++ b/config/app.php @@ -232,7 +232,9 @@ return [ |-------------------------------------------------------------------------- | V2board version |-------------------------------------------------------------------------- + | + | The only modification by laravel config + | */ - 'version' => '1.1.3' ]; diff --git a/database/update.sql b/database/update.sql index 00d0d92d..ed01581e 100644 --- a/database/update.sql +++ b/database/update.sql @@ -168,3 +168,13 @@ ADD `category_id` int(11) NOT NULL AFTER `id`; ALTER TABLE `v2_tutorial` DROP `description`; + +ALTER TABLE `v2_plan` +ADD `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0: 周期 1:一次性' AFTER `name`; + +ALTER TABLE `v2_plan` +CHANGE `month_price` `month_price` int(11) NULL AFTER `content`, +CHANGE `quarter_price` `quarter_price` int(11) NULL AFTER `month_price`, +CHANGE `half_year_price` `half_year_price` int(11) NULL AFTER `quarter_price`, +CHANGE `year_price` `year_price` int(11) NULL AFTER `half_year_price`, +ADD `onetime_price` int(11) NULL AFTER `year_price`;