done cleaning

This commit is contained in:
mynah
2020-01-20 18:19:38 -06:00
parent 7dfd107c04
commit f16d579996
19 changed files with 165 additions and 144 deletions

View File

@@ -1,6 +1,6 @@
select distinct
month(tienda_evento.fecha_inicio) as month,
year(tienda_evento.fecha_inicio) as year,
date_format(tienda_evento.fecha_inicio,'%Y%m') as id
from tienda_evento
month(t.fecha_inicio) as month,
year(t.fecha_inicio) as year,
date_format(t.fecha_inicio,'%Y%m') as id
from curso_tienda as t
where estado=1 and estore = 1;

View File

@@ -1,20 +1,20 @@
select
date_format(tienda_evento.fecha_inicio,'%Y%m') as bid,
tienda_evento.id as eeid,
concat(lugar.municipio,", ",lugar.federativa) as ciudad,
concat(lugar.nombre,". ") as lugar,
lugar.direccion as dir,
day(tienda_evento.fecha_inicio) as dini,
day(tienda_evento.fecha_fin) as dfin,
month(tienda_evento.fecha_inicio) as mini,
month(tienda_evento.fecha_fin) as mfin,
curso.nombre as nombre,
tienda_evento.imagen_chica as imagen_chica
from tienda_evento
inner join lugar on tienda_evento.lugar_id=lugar.id
inner join curso on tienda_evento.curso_id=curso.id
where tienda_evento.estado=1 and tienda_evento.estore=1
order by tienda_evento.fecha_inicio
date_format(t.fecha_inicio,'%Y%m') as bid,
t.id as eeid,
concat(l.municipio,", ",l.federativa) as ciudad,
concat(l.nombre,". ") as lugar,
l.direccion as dir,
day(t.fecha_inicio) as dini,
day(t.fecha_fin) as dfin,
month(t.fecha_inicio) as mini,
month(t.fecha_fin) as mfin,
c.nombre as nombre,
t.imagen_chica as imagen_chica
from curso_tienda as t
inner join curso_lugar as l on t.lugar_id=l.id
inner join curso as c on t.curso_id=c.id
where t.estado=1 and t.estore=1
order by t.fecha_inicio
;

View File

@@ -1,26 +1,27 @@
select
curso.nombre as cname,
concat(lugar.municipio,', ',lugar.federativa) as place,
c.nombre as cname,
concat(l.municipio,', ',l.federativa) as place,
lugar.direccion as paddr,
lugar.observacion as pobs,
lugar.municipio as city,
tienda_evento.precio as cost,
tienda_evento.spay as spay,
case tienda_evento.promo_estado when 1 then coalesce(tienda_evento.promocion,"") else "" end as promo,
curso.temario as csubjects,
curso.servicios as cservices,
lugar.nombre as pname,
day(tienda_evento.fecha_inicio) as dini,
day(tienda_evento.fecha_fin) as dend,
month(tienda_evento.fecha_inicio) as mini,
month(tienda_evento.fecha_fin) as mend
l.direccion as paddr,
l.observacion as pobs,
l.municipio as city,
t.precio as cost,
t.spay as spay,
case t.promo_estado when 1 then coalesce(t.promocion,"") else "" end as promo,
c.descripcion as cdescription,
c.temario as csubjects,
c.servicios as cservices,
l.nombre as pname,
day(t.fecha_inicio) as dini,
day(t.fecha_fin) as dend,
month(t.fecha_inicio) as mini,
month(t.fecha_fin) as mend
from tienda_evento
inner join lugar on tienda_evento.lugar_id=lugar.id
inner join curso on tienda_evento.curso_id=curso.id
where tienda_evento.estado=1
and tienda_evento.id = ?
from curso_tienda as t
inner join curso_lugar as l on t.lugar_id=l.id
inner join curso as c on t.curso_id=c.id
where t.estado=1
and t.id = ?
;

View File

@@ -1,14 +1,30 @@
select
id,
objeto,
nombre,
precio,
subnombre,
promocion,
opcion,
descripcion,
imagenb as "imagen",
existencia,
entrega_id "entrega_id"
from tienda where id=? and activo =1;
select
t.id as tid,
c.nombre as nombre,
c.subnombre as subnombre,
c.descripcion as descripcion,
c.maestro as maestro,
c.imagen_a as cimga,
c.imagen_b as cimgb,
c.imagen_c as cimgc,
day(t.fecha_inicio) as dini,
month(t.fecha_inicio) as mini,
day(t.fecha_fin) as dfin,
month(t.fecha_fin) as mfin,
t.precio as precio,
t.promocion as promo,
t.promo_estado as promo_estado,
t.playera_estado as playera_estado,
t.cupo as cupo,
l.nombre as lnombre,
l.federativa as federativa,
l.pais as pais,
l.municipio as municipio
from curso_tienda as t
join curso as c on c.id = t.curso_id
join curso_lugar as l on l.id = t.lugar_id
where t.id=? and t.estado =1
;

View File

@@ -36,14 +36,9 @@ sub event{
return $r;
}
sub spay {
sub spay{
my ($c,$class,$id) = @_;
return _read ($data_path->child("spay/qIdStore.q")->slurp,$id)->[0];
}
sub store_id {
my ($c,$class,$id) = @_;
my $r = _read ($data_path->child("store/qEstore.q")->slurp,$id)->[0];
my $r = shift @{ _read ($data_path->child("spay/qIdStore.q")->slurp,$id)};
$r->{fecha} = mtxt( $r->{dini},$r->{mini},$r->{dfin},$r->{mfin});
return $r;
}