mirror of
https://github.com/v2board/v2board.git
synced 2025-02-10 23:49:12 +08:00
update: admin replyed reopen ticket
This commit is contained in:
parent
36f87bd61f
commit
6f849664cc
@ -184,6 +184,7 @@ class TelegramController extends Controller
|
||||
abort(500, '用户不存在');
|
||||
}
|
||||
$ticketService = new TicketService();
|
||||
if (!$msg->text) return;
|
||||
if ($user->is_admin || $user->is_staff) {
|
||||
$ticketService->replyByAdmin(
|
||||
$ticketId,
|
||||
|
@ -12,15 +12,12 @@ use Illuminate\Support\Facades\DB;
|
||||
class TicketService {
|
||||
public function replyByAdmin($ticketId, $message, $userId):void
|
||||
{
|
||||
if ($message)
|
||||
$ticket = Ticket::where('id', $ticketId)
|
||||
->first();
|
||||
if (!$ticket) {
|
||||
abort(500, '工单不存在');
|
||||
}
|
||||
if ($ticket->status) {
|
||||
abort(500, '工单已关闭,无法回复');
|
||||
}
|
||||
$ticket->status = 0;
|
||||
DB::beginTransaction();
|
||||
$ticketMessage = TicketMessage::create([
|
||||
'user_id' => $userId,
|
||||
|
Loading…
Reference in New Issue
Block a user