diff --git a/app/Http/Requests/Admin/TutorialSave.php b/app/Http/Requests/Admin/TutorialSave.php index fda69aa7..b1b0211e 100644 --- a/app/Http/Requests/Admin/TutorialSave.php +++ b/app/Http/Requests/Admin/TutorialSave.php @@ -8,7 +8,8 @@ class TutorialSave extends FormRequest { CONST RULES = [ 'title' => 'required', - 'category' => 'required|in:windows,macos,ios,android,linux,router', + // 1:windows 2:macos 3:ios 4:android 5:linux 6:router + 'category' => 'required|in:1,2,3,4,5,6', 'description' => 'required', 'icon' => 'required' ]; diff --git a/database/update.sql b/database/update.sql index 41bbb016..bdecdca6 100644 --- a/database/update.sql +++ b/database/update.sql @@ -164,4 +164,4 @@ ALTER TABLE `v2_order` ADD `refund_amount` int(11) NULL COMMENT '退款金额' AFTER `surplus_amount`; ALTER TABLE `v2_tutorial` -ADD `category` varchar(255) COLLATE 'utf8_general_ci' NOT NULL AFTER `description`; +ADD `category_id` int(11) NOT NULL AFTER `id`;