Last active
March 13, 2020 20:01
-
-
Save parzibyte/6fc6ba16744e8c0b3c6f49a04b382d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows, err := bd.Raw(`select sum(operaciones_de_cortes.precio * bultos_de_cortes.piezas) as ganancia, | |
empleados.id | |
from bihorarios | |
inner join bultos_de_empleados | |
on bihorarios.id_bulto_de_empleado = bultos_de_empleados.id | |
inner join operaciones_de_cortes | |
on operaciones_de_cortes.id = bultos_de_empleados.id_operacion_de_corte | |
inner join empleados | |
on bultos_de_empleados.id_empleado = empleados.id | |
inner join bultos_de_cortes | |
on bultos_de_cortes.id = bultos_de_empleados.id_bulto_de_corte | |
where bultos_de_empleados.fecha_terminacion != '' | |
and bultos_de_empleados.fecha_terminacion >= ? | |
and bultos_de_empleados.fecha_terminacion <= ? | |
group by empleados.id;`, fechaInicio, fechaFin). | |
Rows() | |
if err != nil { | |
return empleados, err | |
} | |
defer rows.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment