|
|
@@ -171,6 +171,15 @@ if($submit) {
|
|
|
return Geolocation::getDistance($lat_lng, $a->getGeolocation()) <=> Geolocation::getDistance($lat_lng, $b->getGeolocation());
|
|
|
});
|
|
|
|
|
|
+ $user_ids = array_column($addresses, "user_id");
|
|
|
+
|
|
|
+ $reject_data = [];
|
|
|
+
|
|
|
+ $reject_rows = UserLocationReject::query(["user_id" => $user_ids, "location_id" => $location_id]);
|
|
|
+ foreach($reject_rows as $reject_row) {
|
|
|
+ $reject_data[$reject_row->user_id] = $reject_row;
|
|
|
+ }
|
|
|
+
|
|
|
$output = [];
|
|
|
|
|
|
foreach($addresses as $address) {
|
|
|
@@ -199,6 +208,14 @@ if($submit) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ $rejected = $reject_data[$user->id] ?? null;
|
|
|
+ $last_rejected = null;
|
|
|
+ $reject_count = 0;
|
|
|
+ if($rejected) {
|
|
|
+ $last_rejected = $rejected->getDateTimeLastRejected()->format("d/m/Y");
|
|
|
+ $reject_count = $rejected->reject_count;
|
|
|
+ }
|
|
|
+
|
|
|
$distance_miles = Geolocation::getDistance($location->getGeolocation(), $address->getGeolocation());
|
|
|
$distance_kilometers = $distance_miles * Geolocation::KMS_IN_MILE;
|
|
|
|
|
|
@@ -251,6 +268,9 @@ if($submit) {
|
|
|
"reportedComment" => $user->reported_comment,
|
|
|
"timeRegistered" => strtotime($user->dts_registered . " UTC"),
|
|
|
"timeLastTest" => $time_last_test,
|
|
|
+ "rejected" => (bool) $rejected,
|
|
|
+ "rejectCount" => (int) $reject_count,
|
|
|
+ "dateLastRejected" => $last_rejected
|
|
|
];
|
|
|
|
|
|
}
|