add total for notification

This commit is contained in:
2025-07-14 16:58:29 +03:30
parent faec6195b3
commit 1aff61aece
2 changed files with 6 additions and 10 deletions

View File

@@ -215,6 +215,8 @@ class NotificationController extends Controller
])->count();
}
$missions['total'] = $missions['request_portal'] + $missions['transportation'] + $missions['control'];
return $missions;
}
}

View File

@@ -61,16 +61,10 @@ class RahdaranController extends Controller
public function search(Request $request): JsonResponse
{
if ($request->has('code')) {
$matchedSearchedRahdaran = Rahdaran::query()
->where('code', 'LIKE', "%{$request->code}%")
->get();
}
else {
$matchedSearchedRahdaran = Rahdaran::query()
->where('name', 'LIKE', "%{$request->name}%")
->get();
}
$matchedSearchedRahdaran = Rahdaran::query()
->where('code', 'LIKE', "%{$request->search}%")
->orWhere('name', 'LIKE', "%{$request->search}%")
->get();
return $this->successResponse($matchedSearchedRahdaran);
}