Skip to content

Commit

Permalink
Fix propiedad empresa destino clone club
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoftpy committed May 4, 2021
1 parent 48ea91c commit bd4e0c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/Http/Controllers/CloneController.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,12 @@ public function cloneClub(Request $request)

$empresas = json_decode($request->empresas);
foreach ($empresas as $empresa) {
//dd($empresa);
$encuesta = Cabecera_encuesta::find($empresa->encuesta);
if($encuesta){
$cabecera = $encuesta->replicate();
$cabecera->rubro_id = $request->rubro_id;
$cabecera->periodo = $request->periodo;
$cabecera->empresa_id = $empresa->empresa_destino;
$cabecera->empresa_id = $empresa->destino;
$cabecera->save();
$encuestaCargo = $encuesta->encuestasCargo;
foreach($encuestaCargo as $cargo){
Expand Down
2 changes: 1 addition & 1 deletion resources/views/encuestas/clone/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
</div>

<input id="empresas" type="text" name="empresas">
<input id="empresas" type="hidden" name="empresas">
<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
<div class="button-group">
<a class="btn waves-effect waves-light amber" href="#" id="add">Opción
Expand Down

0 comments on commit bd4e0c9

Please sign in to comment.