1
0
forked from poc/pds

Issue solved in filter in connection type

This commit is contained in:
dhanabalan
2025-06-07 16:36:58 +05:30
parent 88802d8a11
commit cac691c82d
5 changed files with 32 additions and 23 deletions

View File

@@ -488,16 +488,19 @@ class TestingPanelReadingResource extends Resource
->searchable()
->options(function (callable $get) {
$plantId = $get('Plant');
return Item::where('plant_id', $plantId)->whereHas('motorTestingMasters')->pluck('code', 'id')->toArray();
// $query = Item::query();
// if ($plantId) {
// $query->where('plant_id', $plantId);
// }
// return $query->pluck('code', 'id')->toArray();
if ($plantId) {
return Item::where('plant_id', $plantId)
->whereHas('motorTestingMasters')
->pluck('code', 'id')
->toArray();
}
else
{
return Item::whereHas('motorTestingMasters')
->pluck('code', 'id')
->toArray();
}
//return [];
})
->reactive(),
Select::make('machine_name')
@@ -587,12 +590,14 @@ class TestingPanelReadingResource extends Resource
{
return Configuration::where('plant_id', $plantId)
->where('c_name', 'MOTOR_CONNECTION')
->orderBy('created_at')
->pluck('c_value', 'c_value')
->toArray();
}
else
{
return Configuration::where('c_name', 'MOTOR_CONNECTION')
->orderBy('created_at')
->pluck('c_value', 'c_value')
->toArray();
}