mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-04 19:49:16 +00:00
Fixed Ticket using wrong URL
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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' => '关闭成功']);
|
||||
|
||||
Reference in New Issue
Block a user