diff --git a/lib/Dojo/Controller/Home.pm b/lib/Dojo/Controller/Home.pm index d30d08f..9b6f10d 100755 --- a/lib/Dojo/Controller/Home.pm +++ b/lib/Dojo/Controller/Home.pm @@ -114,7 +114,7 @@ sub contact2{ sub store{ my $c = shift; - $c->stash( r=>$c->dbv->store); + $c->stash( r=>$c->dbg->store); $c->stash(layout=> "defaultContact"); } diff --git a/lib/Dojo/Model/Data/store/qStore.q b/lib/Dojo/Model/Data/store/qStore.q index 1049aeb..00d2b4b 100755 --- a/lib/Dojo/Model/Data/store/qStore.q +++ b/lib/Dojo/Model/Data/store/qStore.q @@ -1,10 +1,10 @@ select - nombre as "titulo", - descripcion as "descripcion", + id, + objeto as "objeto", + nombre as "nombre", precio as "precio", - opcion as "opciones", + subnombre as "subnombre", promocion as "promocion", imagen as "imagen" - -from tienda where precio >= -1; +from tienda where activo =1; diff --git a/lib/Dojo/Model/Users.pm b/lib/Dojo/Model/Users.pm index 044cb18..2f8bc9e 100755 --- a/lib/Dojo/Model/Users.pm +++ b/lib/Dojo/Model/Users.pm @@ -3,10 +3,12 @@ package Dojo::Model::Users; use strict; use warnings; +use Mojo::File 'path'; use DBI; use Mojo::Util 'secure_compare'; use Dojo::Conf; +my $data_path = path('lib/Dojo/Model/Data')->make_path; sub new { bless {}, shift } sub createu{ @@ -56,6 +58,10 @@ sub check { return $r->{pid} // 0; } +sub store{ + return _read ($data_path->child("/store/qStore.q")->slurp); +} + sub _read{ my ($q,@bind)=@_; my (@empty,$arr); diff --git a/lib/Dojo/Model/Vuelo.pm b/lib/Dojo/Model/Vuelo.pm index 031f974..394cadf 100755 --- a/lib/Dojo/Model/Vuelo.pm +++ b/lib/Dojo/Model/Vuelo.pm @@ -41,9 +41,6 @@ sub event{ my ($c,$id)=@_; return shift @{ _read ($data_path->child("event/qEvent.q")->slurp,$id)}; } -sub store{ - return _read ($data_path->child("/store/qStore.q")->slurp); -} sub tv_videos{ return _read ($data_path->child("/tv/qSeries.q")->slurp); #group,name } diff --git a/templates/home/store.html.ep b/templates/home/store.html.ep index 839e7a5..6317874 100755 --- a/templates/home/store.html.ep +++ b/templates/home/store.html.ep @@ -5,10 +5,12 @@
{imagen} "%> >
-

<%= $_->{titulo} %>

-

<%= $_->{descripcion} %>

-

$<%= $_->{precio} %> pesos

-

<%= $_->{opciones} %>

+

<%= $_->{objeto} %>

+

<%= $_->{nombre} %>

+ % if ( $_->{precio} != -1){ +

$<%= $_->{precio} %> pesos

+ %} +

<%= $_->{subnombre} %>

<%= $_->{promocion} %>