@@ -45,12 +45,17 @@ public function index() {
45
45
->paginate (paginateCount ());
46
46
} else {
47
47
$ appointments = UserAppointment::unapproved ()
48
- ->whereNull ('expert_profile_id ' )
49
48
->with ('map ' , 'user ' )
50
49
->where (function (Builder $ builder ){
51
50
if (request ('map_id ' )) {
52
51
$ builder ->where ('map_id ' , request ('map_id ' ));
53
52
}
53
+
54
+ if (request ('consultation ' )) {
55
+ $ builder ->whereNotNull ('expert_profile_id ' );
56
+ } else {
57
+ $ builder ->whereNull ('expert_profile_id ' );
58
+ }
54
59
})
55
60
->latest ()
56
61
->paginate (paginateCount ());
@@ -115,12 +120,16 @@ public function approvedList() {
115
120
->paginate (paginateCount ());
116
121
} else {
117
122
$ appointments = UserAppointment::approvedOnly ()
118
- ->whereNull ('expert_profile_id ' )
119
123
->with ('map ' , 'user ' )
120
124
->where (function (Builder $ builder ){
121
125
if (request ('map_id ' )) {
122
126
$ builder ->where ('map_id ' , request ('map_id ' ));
123
127
}
128
+ if (request ('consultation ' )) {
129
+ $ builder ->whereNotNull ('expert_profile_id ' );
130
+ } else {
131
+ $ builder ->whereNull ('expert_profile_id ' );
132
+ }
124
133
})
125
134
->latest ()
126
135
->paginate (paginateCount ());
@@ -147,12 +156,16 @@ public function completedList() {
147
156
->paginate (paginateCount ());
148
157
} else {
149
158
$ appointments = UserAppointment::completedOnly ()
150
- ->whereNull ('expert_profile_id ' )
151
159
->with ('map ' , 'user ' )
152
160
->where (function (Builder $ builder ){
153
161
if (request ('map_id ' )) {
154
162
$ builder ->where ('map_id ' , request ('map_id ' ));
155
163
}
164
+ if (request ('consultation ' )) {
165
+ $ builder ->whereNotNull ('expert_profile_id ' );
166
+ } else {
167
+ $ builder ->whereNull ('expert_profile_id ' );
168
+ }
156
169
})
157
170
->latest ()
158
171
->paginate (paginateCount ());
0 commit comments