This commit is contained in:
root 2019-12-13 22:30:45 +08:00
parent b1edb5baf3
commit d20c8cbd42
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class TicketController extends Controller
}
$ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get();
for ($i = 0; $i < count($ticket['message']); $i++) {
if ($ticket['message'][$i]['user_id'] == $request->session()->get('id')) {
if ($ticket['message'][$i]['user_id'] !== $ticket->user_id) {
$ticket['message'][$i]['is_me'] = true;
} else {
$ticket['message'][$i]['is_me'] = false;

View File

@ -22,7 +22,7 @@ class TicketController extends Controller
}
$ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get();
for ($i = 0; $i < count($ticket['message']); $i++) {
if ($ticket['message'][$i]['user_id'] == $request->session()->get('id')) {
if ($ticket['message'][$i]['user_id'] == $ticket->user_id) {
$ticket['message'][$i]['is_me'] = true;
} else {
$ticket['message'][$i]['is_me'] = false;