Pārlūkot izejas kodu

save ptype in form submitted collection

ifah
Siti Hajar Ibrahim pirms 5 gadiem
vecāks
revīzija
c92ece08e8
1 mainītis faili ar 9 papildinājumiem un 6 dzēšanām
  1. 9
    6
      app/Http/Controllers/Form/ResidentialController.php

+ 9
- 6
app/Http/Controllers/Form/ResidentialController.php Parādīt failu

@@ -255,17 +255,18 @@ class ResidentialController extends Controller
$pathVisaB = '/'.$destinationPath.'/visaB.'.strtolower($icon->getClientOriginalExtension());
}

$coverage = Coverage::where('_id',$request->coverage)->first();
$product = Product::where('formT','R')->where('package_name',$request->package)->first();

$sl = Form::create([
'type_service' => $request->application,
'type_application' => 'R',
'project_type' => $coverage->project_type,
'status_payment' => 'paid',
'status_email' => 'unverified',
'remark_form' => ''
]);

$coverage = Coverage::where('_id',$request->coverage)->first();
$product = Product::where('formT','R')->where('package_name',$request->package)->first();

$sdl = new Subscriber();
$sdl->subscriber_id = $su_id;
$sdl->name = $request->name;
@@ -541,9 +542,13 @@ class ResidentialController extends Controller
// staff
$staff = Staff::with('StaffDetail')->where('_id',$request->dealer_id)->first();
if(!empty($staff)){
$coverage = Coverage::where('_id',$request->coverage)->first();
$product = Product::where('formT','R')->where('package_name',$request->package)->first();

$sl = new Form();
$sl->type_service = $request->application;
$sl->type_application = 'R';
$sl->project_type = $coverage->project_type;
$sl->status_payment = 'paid';
$sl->status_email = 'unverified';
$sl->remark_form = '';
@@ -551,9 +556,7 @@ class ResidentialController extends Controller
$sl->company_id = $staff->StaffDetail->company_id;
$staff->form()->save($sl);
$coverage = Coverage::where('_id',$request->coverage)->first();
$product = Product::where('formT','R')->where('package_name',$request->package)->first();

$sdl = new Subscriber();
$sdl->subscriber_id = $su_id;
$sdl->name = $request->name;

Notiek ielāde…
Atcelt
Saglabāt