Issue solved in filter in connection type
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user