diff --git a/app/Services/TicketService.php b/app/Services/TicketService.php index ee36de58..8176112e 100644 --- a/app/Services/TicketService.php +++ b/app/Services/TicketService.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\DB; class TicketService { public function replyByAdmin($ticketId, $message, $userId):void { + if ($message) $ticket = Ticket::where('id', $ticketId) ->first(); if (!$ticket) { diff --git a/database/install.sql b/database/install.sql index 3aab50ce..30b4d13a 100644 --- a/database/install.sql +++ b/database/install.sql @@ -207,7 +207,9 @@ CREATE TABLE `v2_server_log` ( `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`), - KEY `log_at` (`log_at`) + KEY `log_at` (`log_at`), + KEY `user_id` (`user_id`), + KEY `server_id` (`server_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -305,7 +307,7 @@ CREATE TABLE `v2_ticket_message` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `ticket_id` int(11) NOT NULL, - `message` varchar(255) NOT NULL, + `message` text CHARACTER SET utf8mb4 NOT NULL, `created_at` int(11) NOT NULL, `updated_at` int(11) NOT NULL, PRIMARY KEY (`id`) @@ -349,4 +351,4 @@ CREATE TABLE `v2_user` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --- 2021-07-30 17:19:01 +-- 2021-08-18 12:22:48 diff --git a/database/update.sql b/database/update.sql index feb36c38..5873c0ce 100644 --- a/database/update.sql +++ b/database/update.sql @@ -432,3 +432,6 @@ ALTER TABLE `v2_order` ALTER TABLE `v2_server_log` ADD INDEX `user_id` (`user_id`), ADD INDEX `server_id` (`server_id`); + +ALTER TABLE `v2_ticket_message` + CHANGE `message` `message` text COLLATE 'utf8mb4_general_ci' NOT NULL AFTER `ticket_id`;