コード例 #1
0
 public function postEliminar()
 {
     $organizacion = Organizacion::find(Input::get('id'));
     $productor = Productor::where('organizacion_id', '=', Input::get('id'));
     if ($productor->count()) {
         $productor = $productor->first();
         $productor->organizacion_id = 0;
         $productor->save();
     }
     $organizacion->delete();
 }
コード例 #2
0
 public function postEliminar()
 {
     $medio = Medio::where('productor_id', '=', Input::get('id'));
     if ($medio->count()) {
         $medio->delete();
     }
     $certificacion = Certificacion_Productor::where('productor_id', '=', Input::get('id'));
     if ($certificacion->count()) {
         $certificacion->delete();
     }
     $finca = Finca::where('productor_id', '=', Input::get('id'));
     if ($finca->count()) {
         $finca = $finca->first();
         $lote = Lote::where('finca_id', '=', $finca->id);
         $lote->delete();
         $finca->delete();
     }
     $productor = Productor::where('id', '=', Input::get('id'));
     $productor->delete();
 }