diff --git a/app/Http/Controllers/V3/NotificationController.php b/app/Http/Controllers/V3/NotificationController.php index 23c928f6..b05f9f72 100644 --- a/app/Http/Controllers/V3/NotificationController.php +++ b/app/Http/Controllers/V3/NotificationController.php @@ -215,6 +215,8 @@ class NotificationController extends Controller ])->count(); } + $missions['total'] = $missions['request_portal'] + $missions['transportation'] + $missions['control']; + return $missions; } } diff --git a/app/Http/Controllers/V3/RahdaranController.php b/app/Http/Controllers/V3/RahdaranController.php index 12ebc614..e287ff84 100644 --- a/app/Http/Controllers/V3/RahdaranController.php +++ b/app/Http/Controllers/V3/RahdaranController.php @@ -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); }