@@ -93,9 +93,9 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
93
93
}
94
94
if ($ expertProfile != null ) {
95
95
$ q ->where ('user_id ' , $ expertProfile ->user_id );
96
- }else {
97
- $ q ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
98
- }
96
+ } else {
97
+ $ q ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
98
+ }
99
99
})->latest ()->get ()->pluck ('thana ' );
100
100
$ banners = getRecords ('banners ' );
101
101
$ infos1 = Info::where ('section_id ' , 1 )->latest ()->get ();
@@ -126,19 +126,22 @@ public function aboutPage()
126
126
}
127
127
public function officePage (Request $ request )
128
128
{
129
- $ maps = Map::where (function (Builder $ q ) use ($ request ) {
129
+ $ admin = User::role ('super admin ' )->first ();
130
+ $ maps = Map::where (function (Builder $ q ) use ($ request , $ admin ) {
130
131
if ($ request ->query ('thana ' )) {
131
132
$ q ->where ('thana ' , $ request ->query ('thana ' ));
132
133
}
133
134
if ($ request ->query ('district ' )) {
134
135
$ q ->where ('district ' , $ request ->query ('district ' ));
135
136
}
137
+ $ q ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
136
138
})->latest ()->get ();
137
139
$ districts = Map::select ([ 'district ' , 'thana ' ])->distinct ()->latest ()->get ()->pluck ('district ' );
138
- $ thanas = Map::select ([ 'district ' , 'thana ' ])->distinct ()->where (function (Builder $ q ) use ($ request ) {
140
+ $ thanas = Map::select ([ 'district ' , 'thana ' ])->distinct ()->where (function (Builder $ q ) use ($ request, $ admin ) {
139
141
if (!empty ($ request ->query ('district ' ))) {
140
142
$ q ->where ('district ' , $ request ->query ('district ' ));
141
143
}
144
+ $ q ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
142
145
})->latest ()->get ()->pluck ('thana ' );
143
146
return view ('frontend.pages.office ' , compact ('maps ' , 'districts ' , 'thanas ' ));
144
147
}
0 commit comments