Nur Zarifah Mohd Zain 5 years ago
parent
commit
58fb0c27a1

+ 1
- 0
app/Http/Controllers/CustomerService/WorkOrderController.php View File

$product = Product::where('speed',$form->PackageDetail->name)->where('formT',$w->Form->type_application)->first(); $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$w->Form->type_application)->first();
$company = Company::where('_id',$w->contractor_id)->first(); $company = Company::where('_id',$w->contractor_id)->first();


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

+ 31
- 1
app/Http/Controllers/DS/MarketingController.php View File

$var1 = $installer->name; $var1 = $installer->name;
} }


if (empty($a->Form->customer_category)) {
$category = '';
} else {
$category = $a->Form->customer_category;
}



if ($a->Form->type_application == "R") { if ($a->Form->type_application == "R") {
$r++; $r++;
array_push($nested_data, array( array_push($nested_data, array(
'index' => $r . $n1, 'index' => $r . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
array_push($nested_data, array( array_push($nested_data, array(
'index' => $b . $n1, 'index' => $b . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
$var1 = $installer->name; $var1 = $installer->name;
} }


if (empty($a->Form->customer_category)) {
$category = '';
} else {
$category = $a->Form->customer_category;
}


if ($a->Form->type_application == "R") { if ($a->Form->type_application == "R") {
$r++; $r++;
array_push($nested_data, array( array_push($nested_data, array(
'index' => $r . $n1, 'index' => $r . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
array_push($nested_data, array( array_push($nested_data, array(
'index' => $b . $n1, 'index' => $b . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
$var1 = $installer->name; $var1 = $installer->name;
} }


if (empty($a->Form->customer_category)) {
$category = '';
} else {
$category = $a->Form->customer_category;
}


if ($a->Form->type_application == "R") { if ($a->Form->type_application == "R") {
$r++; $r++;
array_push($nested_data, array( array_push($nested_data, array(
'index' => $r . $n1, 'index' => $r . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
array_push($nested_data, array( array_push($nested_data, array(
'index' => $b . $n1, 'index' => $b . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
$var1 = $installer->name; $var1 = $installer->name;
} }


if (empty($a->Form->customer_category)) {
$category = '';
} else {
$category = $a->Form->customer_category;
}



if ($a->Form->type_application == "R") { if ($a->Form->type_application == "R") {
$r++; $r++;
array_push($nested_data, array( array_push($nested_data, array(
'index' => $r . $n1, 'index' => $r . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
array_push($nested_data, array( array_push($nested_data, array(
'index' => $b . $n1, 'index' => $b . $n1,
'nature_work' => $a->nature_work, 'nature_work' => $a->nature_work,
'customer_category' => $category,
'wo' => $a->wo, 'wo' => $a->wo,
'customer_name' => $customer->name, 'customer_name' => $customer->name,
'customer_phone' => $customer->phone1, 'customer_phone' => $customer->phone1,
}], 'Staff')->where('formT', 'B')->where('dealer', $company)->where('activated_my', $month . '/' . $year)->orderBy('activated_dt', 'DESC')->get(); }], 'Staff')->where('formT', 'B')->where('dealer', $company)->where('activated_my', $month . '/' . $year)->orderBy('activated_dt', 'DESC')->get();
} }
} else if ($year != 'null' && $month != 'null' && $app != 'null' && $ptype != 'null') { } else if ($year != 'null' && $month != 'null' && $app != 'null' && $ptype != 'null') {
if ($app == 'Residential') { if ($app == 'Residential') {
$dataClaim = DealerClaim::with(['Subscriber' => function ($q) { $dataClaim = DealerClaim::with(['Subscriber' => function ($q) {
$q->with('Form'); $q->with('Form');

Loading…
Cancel
Save