changed query logic in panel box validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 3m46s
Laravel Larastan / larastan (pull_request) Failing after 6m6s

This commit is contained in:
dhanabalan
2026-10-10 09:19:11 +05:30
parent 1d0ffebd76
commit db129555bc

View File

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