@@ -79,7 +79,7 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
79
79
} else {
80
80
$ maps = [ $ office ];
81
81
}
82
- $ branchDistricts = Map::select ([ 'district ' , ' thana ' , 'user_id ' ])
82
+ $ branchDistricts = Map::select ([ 'district ' ,'user_id ' ])
83
83
->where (function (Builder $ q ) use ($ request , $ expertProfile , $ admin ) {
84
84
if ($ expertProfile != null ) {
85
85
$ q ->where ('user_id ' , $ expertProfile ->user_id );
@@ -89,7 +89,7 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
89
89
});
90
90
}
91
91
})
92
- ->distinct ()->latest ()->get ()->pluck ('district ' );
92
+ ->distinct ()->latest ()->get ()->unique ( ' district ' )-> pluck ('district ' );
93
93
$ branchThanas = Map::select ([ 'district ' , 'thana ' , 'user_id ' ])
94
94
->distinct ()
95
95
->where (function (Builder $ q ) use ($ request , $ expertProfile , $ admin , $ defaultDistrict ) {
@@ -103,7 +103,7 @@ public function appointmentPage(Request $request, ?ExpertProfile $expertProfile
103
103
$ builder ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
104
104
});
105
105
}
106
- })->latest ()->get ()->pluck ('thana ' );
106
+ })->latest ()->get ()->unique ( ' thana ' )-> pluck ('thana ' );
107
107
$ banners = getRecords ('banners ' );
108
108
$ infos1 = Info::where ('section_id ' , 1 )->latest ()->get ();
109
109
$ testimonials = \App \Models \Review::with ('user ' )->latest ()->limit (10 )->latest ()->get ();
@@ -145,21 +145,21 @@ public function officePage(Request $request)
145
145
$ builder ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
146
146
});
147
147
})->latest ()->get ();
148
- $ districts = Map::select ([ 'district ' , ' thana ' ])->distinct ()
148
+ $ districts = Map::select ([ 'district ' ])->distinct ()
149
149
->where (function (Builder $ q ) use ($ admin ) {
150
150
$ q ->where (function (Builder $ builder ) use ($ admin ) {
151
151
$ builder ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
152
152
});
153
153
154
- })->latest ()->get ()->pluck ('district ' );
155
- $ thanas = Map::select ([ ' district ' , ' thana ' ])-> distinct ()-> where (function (Builder $ q ) use ($ request , $ admin ) {
154
+ })->latest ()->get ()->unique ( ' district ' )-> pluck ('district ' );
155
+ $ thanas = Map::where (function (Builder $ q ) use ($ request , $ admin ) {
156
156
if (!empty ($ request ->query ('district ' ))) {
157
157
$ q ->where ('district ' , $ request ->query ('district ' ));
158
158
}
159
159
$ q ->where (function (Builder $ builder ) use ($ admin ) {
160
160
$ builder ->where ('user_id ' , $ admin ->id )->orWhere ('user_id ' , null );
161
161
});
162
- })->latest ()->get ()->pluck ('thana ' );
162
+ })->select ([ ' district ' , ' thana ' ])-> distinct ()-> latest ()->get ()-> unique ( ' thana ' )->pluck ('thana ' );
163
163
return view ('frontend.pages.office ' , compact ('maps ' , 'districts ' , 'thanas ' ));
164
164
}
165
165
public function contactPage ()
0 commit comments