Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2018-08-16 13:18:59 +00:00
committed by StyleCI Bot
parent ffc7206598
commit e972c95441

View File

@@ -1239,8 +1239,8 @@ class ApiController extends Controller
$result = $result->toArray();
$result['title'] = utfEncoding(Ticket_Thread::where('ticket_id', $id)->orderBy('id')->first()->value('title'));
$assigned = Tickets::where('id', $id)->select('assigned_to', 'team_id')->first()->toArray();
if(!empty($assigned)){
if($assigned['assigned_to'] != null){
if (!empty($assigned)) {
if ($assigned['assigned_to'] != null) {
$result['assignee'] = User::where('id', $assigned['assigned_to'])->first()->name();
} elseif ($assigned['team_id'] != null) {
$result['assignee'] = Teams::where('id', $assigned['team_id'])->first()->value('name');
@@ -1248,6 +1248,7 @@ class ApiController extends Controller
$result['assignee'] = null;
}
}
return response()->json(compact('result'));
} catch (\Exception $e) {
$error = $e->getMessage();