Explorar el Código

fix deleted installer

allo_data_retrieve^2
Siti Hajar Ibrahim hace 4 años
padre
commit
8862ef33fa

+ 7
- 7
app/Http/Controllers/Contractor/ContractorController.php Ver fichero

@@ -829,18 +829,18 @@ class ContractorController extends Controller

if(!empty($staff)){
$st = StaffDetail::where('email',$staff->email)->first();
if(!empty($st)){
$st->delete();
$staff->delete();
}

$wo = WorkOrder::where('installer_id',$request->id)->where('status','like','%Pending%')->get();
foreach ($wo as $w){
$wo = WorkOrder::where('installer_id', $request->id)->where('status', 'like', '%Pending%')->get();
foreach ($wo as $w) {
$w->status = "Pending Contractor";
$w->installer_id = "";
$w->save();
}
if(!empty($st)){
$st->delete();
$staff->delete();
}
return 'true';
}else {

+ 1
- 1
app/Http/Controllers/CustomerService/WorkOrderController.php Ver fichero

@@ -288,7 +288,7 @@ class WorkOrderController extends Controller
$product = Product::where('speed', $form->PackageDetail->name)->where('formT', $w->Form->type_application)->first();
$company = Company::where('_id', $w->contractor_id)->first();

// info($w->installer_id);
info($w->installer_id);
if ($w->installer_id != '') {
$installer = Staff::with('StaffDetail')->where('_id', $w->installer_id)->first();
$installer = $installer->StaffDetail->name;

Cargando…
Cancelar
Guardar