mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update: add notice tags
This commit is contained in:
		| @@ -22,7 +22,8 @@ class NoticeController extends Controller | |||||||
|         $data = $request->only([ |         $data = $request->only([ | ||||||
|             'title', |             'title', | ||||||
|             'content', |             'content', | ||||||
|             'img_url' |             'img_url', | ||||||
|  |             'tags' | ||||||
|         ]); |         ]); | ||||||
|         if (!$request->input('id')) { |         if (!$request->input('id')) { | ||||||
|             if (!Notice::create($data)) { |             if (!Notice::create($data)) { | ||||||
|   | |||||||
| @@ -16,7 +16,8 @@ class NoticeSave extends FormRequest | |||||||
|         return [ |         return [ | ||||||
|             'title' => 'required', |             'title' => 'required', | ||||||
|             'content' => 'required', |             'content' => 'required', | ||||||
|             'img_url' => 'nullable|url' |             'img_url' => 'nullable|url', | ||||||
|  |             'tags' => 'nullable|array' | ||||||
|         ]; |         ]; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -25,7 +26,8 @@ class NoticeSave extends FormRequest | |||||||
|         return [ |         return [ | ||||||
|             'title.required' => '标题不能为空', |             'title.required' => '标题不能为空', | ||||||
|             'content.required' => '内容不能为空', |             'content.required' => '内容不能为空', | ||||||
|             'img_url.url' => '图片URL格式不正确' |             'img_url.url' => '图片URL格式不正确', | ||||||
|  |             'tags.array' => '标签格式不正确' | ||||||
|         ]; |         ]; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -11,6 +11,7 @@ class Notice extends Model | |||||||
|     protected $guarded = ['id']; |     protected $guarded = ['id']; | ||||||
|     protected $casts = [ |     protected $casts = [ | ||||||
|         'created_at' => 'timestamp', |         'created_at' => 'timestamp', | ||||||
|         'updated_at' => 'timestamp' |         'updated_at' => 'timestamp', | ||||||
|  |         'tags' => 'array' | ||||||
|     ]; |     ]; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -101,6 +101,7 @@ CREATE TABLE `v2_notice` ( | |||||||
|                              `content` text NOT NULL, |                              `content` text NOT NULL, | ||||||
|                              `show` tinyint(1) NOT NULL DEFAULT '0', |                              `show` tinyint(1) NOT NULL DEFAULT '0', | ||||||
|                              `img_url` varchar(255) DEFAULT NULL, |                              `img_url` varchar(255) DEFAULT NULL, | ||||||
|  |                              `tags` varchar(255) DEFAULT NULL, | ||||||
|                              `created_at` int(11) NOT NULL, |                              `created_at` int(11) NOT NULL, | ||||||
|                              `updated_at` int(11) NOT NULL, |                              `updated_at` int(11) NOT NULL, | ||||||
|                              PRIMARY KEY (`id`) |                              PRIMARY KEY (`id`) | ||||||
| @@ -376,4 +377,4 @@ CREATE TABLE `v2_user` ( | |||||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||||
|  |  | ||||||
|  |  | ||||||
| -- 2022-03-29 06:56:01 | -- 2022-04-14 18:42:31 | ||||||
|   | |||||||
| @@ -557,3 +557,6 @@ ALTER TABLE `v2_stat_user` | |||||||
| DROP `server_id`; | DROP `server_id`; | ||||||
| ALTER TABLE `v2_stat_user` | ALTER TABLE `v2_stat_user` | ||||||
| DROP `server_type`; | DROP `server_type`; | ||||||
|  |  | ||||||
|  | ALTER TABLE `v2_notice` | ||||||
|  |     ADD `tags` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `img_url`; | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								public/assets/admin/umi.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user