Пример #1
0
 public static function paquetes($data)
 {
     DB::setFetchMode(PDO::FETCH_ASSOC);
     $query = Planes_de_pago::join('paqueteplandepago', 'plan_de_pago.id', '=', 'paqueteplandepago.id_plandepago')->where('id_plandepago', '=', $data['id'])->where('idnivel', '=', $data['idnivel'])->where('periodo', '=', $data['periodo'])->first();
     return $query;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     $parametros = Input::get();
     $reglas = array('id' => 'required|integer');
     $validator = Validator::make($parametros, $reglas);
     if (!$validator->fails()) {
         Planes_de_pago::destroy($parametros['id']);
         $res['data'] = Planes_de_pago::All();
         $respuesta = json_encode(array('error' => false, 'mensaje' => '', 'respuesta' => $res));
     } else {
         $respuesta = json_encode(array('error' => true, 'mensaje' => 'No hay parametros o estan mal.', 'respuesta' => null));
     }
     $final_response = Response::make($respuesta, 200);
     $final_response->header('Content-Type', "application/json; charset=utf-8");
     return $final_response;
 }