Esempio n. 1
0
 /**
  * This is for joining users table and tickets table so that i can get the users info in ticket details page
  * @since 11-2-2016
  * @author Saurabh Kumar <*****@*****.**>
  */
 public function getAvaiableUsersDetails()
 {
     try {
         $result = Ticket::join('users', function ($join) {
             $join->on('tickets.user_id', '=', 'users.id');
         })->select()->get();
         return $result;
     } catch (QueryException $e) {
         echo $e;
     }
 }
 public function replyOnTicketsGet($id)
 {
     //        print_r($id);die;
     $objTicket = Ticket::getInstance();
     $whereForData = array('rawQuery' => 'ticket_id=?', 'bindParams' => [$id]);
     $selectedColumns = ['users.*', 'tickets.*', 'ticket_reply.reply_text', 'ticket_reply.created_at', 'ticket_reply.replied_by'];
     $ticketDetails = $objTicket->getUserInfoByTicketId($whereForData, $selectedColumns);
     //        dd($ticketDetails);
     //        $numItems = count($ticketDetails);
     //        $i = 0;
     //        foreach($ticketDetails as $t) {
     //            if (++$i === $numItems) {
     //                $username = $t->username;
     //                $email = $t->email;
     //                $ticket_id = $t->ticket_id;
     //                $subject = $t->subject;
     //                $descriptions = $t->descriptions;
     //                $text = $t->reply_text;
     //            }
     //        }
     //        print_r($username);
     //        print_r($email);
     //        print_r($ticket_id);
     //        print_r($subject);
     //        print_r($descriptions);
     //        print_r($text);
     //        die;
     return view('User::tickets.replyontickets', ['ticketdetails' => $ticketDetails]);
 }