mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-06-25 16:04:37 -05:00
Seperated silence and block counts
Actions taken against and instance of have been separted into their respective buckets so they can be display properly rather than simply grouped together and mislabled. This gives a better sense of the severity of response per instance.
This commit is contained in:
@ -37,7 +37,7 @@ class FrontIndexController extends Controller
|
||||
$raw = DB::select("SELECT * FROM searchlocations(?)", [$terms]);
|
||||
$results = [];
|
||||
foreach ($raw as $item) {
|
||||
if ($item->block_count > 2) {
|
||||
if (($item->block_count + $item->silence_count) > 2) {
|
||||
array_push($results, $item);
|
||||
}
|
||||
}
|
||||
@ -46,6 +46,7 @@ class FrontIndexController extends Controller
|
||||
$count = count($locations);
|
||||
$recent = Location::where("active", true)
|
||||
->where('block_count', '>', 2)
|
||||
->where('silence_count', '>', 2)
|
||||
->limit(10)->orderByDesc('updated_at')->get();
|
||||
|
||||
return view('front.index', [
|
||||
@ -68,15 +69,18 @@ class FrontIndexController extends Controller
|
||||
public function location(string $uuid = "1")
|
||||
{
|
||||
$location = Location::where("uuid", $uuid)->first();
|
||||
$sources = Source::where("active", true)->get();
|
||||
$name = "NO LOCATION FOUND";
|
||||
if ($location) {
|
||||
$name = $location->name;
|
||||
}
|
||||
return view('front.location', [
|
||||
'title' => str_replace(".", " ", $name),
|
||||
'location' => $location,
|
||||
'images' => json_decode($location->images),
|
||||
'updated' => $location->updated_at->format('Y M d'),
|
||||
'title' => str_replace(".", " ", $name),
|
||||
'location' => $location,
|
||||
'actions' => $location->block_count + $location->silence_count,
|
||||
'sources_count' => count($sources),
|
||||
'images' => json_decode($location->images),
|
||||
'updated' => $location->updated_at->format('Y M d'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user