changed query logic in panel box validation #1215

Merged
jothi merged 1 commits from ranjith-dev into master 2026-10-10 03:49:37 +00:00

View File

@@ -1010,11 +1010,19 @@ class PanelBoxValidationResource extends Resource
$inspecLotNo = $get('inspection_lot_number'); $inspecLotNo = $get('inspection_lot_number');
$supplierNo = $get('panel_box_supplier'); $supplierNo = $get('panel_box_supplier');
// $alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
// ->where('plant_id', $plantId)
// ->where('production_order', $pOrder)
// ->where('inspection_lot_number', $inspecLotNo)
// ->first();
$alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber) $alreadyExists = PanelBoxValidation::where('serial_number', $serialNumber)
->where('plant_id', $plantId) ->where('plant_id', $plantId)
->where('production_order', $pOrder) ->where(function ($query) use ($pOrder, $inspecLotNo) {
->where('inspection_lot_number', $inspecLotNo) $query->where('production_order', $pOrder)
->first(); ->orWhere('inspection_lot_number', $inspecLotNo);
})
->first();
$alreadyExistsSupplier = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber) $alreadyExistsSupplier = PanelBoxValidation::where('plant_id', $plantId)->where('serial_number', $serialNumber)
->where('panel_box_supplier', $supplierNo) ->where('panel_box_supplier', $supplierNo)