コード例 #1
0
 function getListJuegoDetalleFactura($condicion = null, $parametros = array())
 {
     if ($condicion === null) {
         $condicion = "";
     } else {
         $condicion = "where {$condicion}";
     }
     $sql = "select ju.*, de.*, fa.*, cl.* from detalle de \r\n                    left join juego ju on ju.id_juego = de.id_juego \r\n                    left join factura fa on fa.num_factura = de.num_factura \r\n                    left join cliente cl on fa.id_cliente = cl.id_cliente  \r\n                {$condicion} ORDER BY cl.email, fa.fecha desc ";
     $this->bd->send($sql, $parametros);
     $r = array();
     $contador = 0;
     while ($fila = $this->bd->getRow()) {
         $juego = new Game();
         $juego->set($fila);
         $detalle = new Detalle();
         $detalle->set($fila, 8);
         $factura = new Factura();
         $factura->set($fila, 13);
         $cliente = new User();
         $cliente->set($fila, 16);
         $r[$contador]["juego"] = $juego;
         $r[$contador]["factura"] = $factura;
         $r[$contador]["detalle"] = $detalle;
         $r[$contador]["cliente"] = $cliente;
         $contador++;
     }
     return $r;
 }
コード例 #2
0
 function get($ID)
 {
     $parametros = array();
     $parametros['ID'] = $ID;
     $this->bd->select($this->tabla, "*", "num_factura=:ID", $parametros);
     $fila = $this->bd->getRow();
     $factura = new Factura();
     $factura->set($fila);
     return $factura;
 }