Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cicer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
meskio
cicer
Commits
d0be5a30
Commit
d0be5a30
authored
4 years ago
by
meskio
Browse files
Options
Downloads
Patches
Plain Diff
Get the right information from DB to display orders
parent
7dd14a38
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/db/order.go
+2
-2
2 additions, 2 deletions
api/db/order.go
api/mail.go
+1
-1
1 addition, 1 deletion
api/mail.go
with
3 additions
and
3 deletions
api/db/order.go
+
2
−
2
View file @
d0be5a30
...
...
@@ -78,7 +78,7 @@ func (d *DB) GetOrder(memberNum int, id int) (order Order, transaction Transacti
}
err
=
d
.
db
.
Where
(
"member = ? AND type = 'order' AND order_id = ?"
,
memberNum
,
id
)
.
Preload
(
"OrderPurchase.OrderProduct"
)
.
Preload
(
"OrderPurchase.OrderProduct
.Product
"
)
.
Find
(
&
transaction
)
.
Error
return
}
...
...
@@ -391,7 +391,7 @@ func (d *DB) DeactivateOrders() []Order {
t
:=
time
.
Date
(
now
.
Year
(),
now
.
Month
(),
now
.
Day
(),
0
,
0
,
0
,
0
,
time
.
Local
)
err
:=
d
.
db
.
Where
(
"active = ? AND deadline < ?"
,
true
,
t
)
.
Preload
(
"Member"
)
.
Preload
(
"Transactions.OrderPurchase.OrderProduct"
)
.
Preload
(
"Transactions.OrderPurchase.OrderProduct
.Product
"
)
.
Preload
(
"Transactions.Member"
)
.
Find
(
&
orders
)
.
Error
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
api/mail.go
+
1
−
1
View file @
d0be5a30
...
...
@@ -25,7 +25,7 @@ Se han pedido:{{range $name, $amount := .Products}}
Las siguientes personas han pedido:
{{range $name, $purchases := .Purchases}}
{{$name}}:{{range $purchases}}
* {{.Product.Name}}: {{.Amount}}{{end}}
* {{.
OrderProduct.
Product.Name}}: {{.Amount}}{{end}}
{{end}}
Salud y garbancicos.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment