Fixed Ticket using wrong URL

This commit is contained in:
兔姬桑
2021-08-24 21:38:42 +08:00
parent 9b27cd4bcd
commit 5bb8d2bb5a
2 changed files with 5 additions and 5 deletions

View File

@@ -10,13 +10,13 @@ class ReportController extends Controller
public function accounting()
{
$orders = Order::where('status', '>=', 2)->whereHas('goods')->latest()->get(['created_at', 'amount']);
$ordersByDay = $orders->where('created_at', '>=', date('Y-m-01', strtotime('-1 months')))->groupBy(function ($item) {
$ordersByDay = $orders->groupBy(function ($item) {
return $item->created_at->format('Y-m-d');
})->map(function ($row) {
return $row->sum('amount');
})->toArray();
$ordersByMonth = $orders->where('created_at', '>=', date('Y-01-01', strtotime('-1 years')))->groupBy(function ($item) {
$ordersByMonth = $orders->groupBy(function ($item) {
return $item->created_at->format('Y-m');
})->map(function ($row) {
return $row->sum('amount');

View File

@@ -42,7 +42,7 @@ class TicketController extends Controller
}
if ($ticket = Ticket::create(['user_id' => $user->id, 'admin_id' => auth()->id(), 'title' => $data['title'], 'content' => clean($data['content'])])) {
$user->notify(new TicketCreated($ticket, route('replyTicket', $ticket)));
$user->notify(new TicketCreated($ticket, route('replyTicket', ['id' => $ticket->id])));
return Response::json(['status' => 'success', 'message' => '工单创建成功']);
}
@@ -71,7 +71,7 @@ class TicketController extends Controller
// 通知用户
if (sysConfig('ticket_replied_notification')) {
$ticket->user->notify(new TicketReplied($reply, route('replyTicket', $ticket), true));
$ticket->user->notify(new TicketReplied($reply, route('replyTicket', ['id' => $ticket->id]), true));
}
return Response::json(['status' => 'success', 'message' => '回复成功']);
@@ -88,7 +88,7 @@ class TicketController extends Controller
}
// 通知用户
if (sysConfig('ticket_closed_notification')) {
$ticket->user->notify(new TicketClosed($ticket->id, $ticket->title, route('replyTicket', $ticket), \request('reason'), true));
$ticket->user->notify(new TicketClosed($ticket->id, $ticket->title, route('replyTicket', ['id' => $ticket->id]), \request('reason'), true));
}
return Response::json(['status' => 'success', 'message' => '关闭成功']);