Skip to content
Snippets Groups Projects
Commit b080177d authored by Réthelyi Bálint's avatar Réthelyi Bálint :no_mouth:
Browse files

Merge branch 'kasszasch' into 'master'

Egyéni hitel opció

See merge request !27
parents da334926 e156ba59
No related branches found
No related tags found
1 merge request!27Egyéni hitel opció
Pipeline #45072 passed
...@@ -46,6 +46,7 @@ type User struct { ...@@ -46,6 +46,7 @@ type User struct {
Money int64 `pg:"money,use_zero"` Money int64 `pg:"money,use_zero"`
IsAdmin bool `pg:"is_admin,default:false"` IsAdmin bool `pg:"is_admin,default:false"`
IsPultosch bool `pg:"is_pultosch,default:false"` IsPultosch bool `pg:"is_pultosch,default:false"`
Credits int64 `pg:"credits,default:5000"`
Spends []*Spend `pg:"rel:has-many,join_fk:user_schacc"` Spends []*Spend `pg:"rel:has-many,join_fk:user_schacc"`
} }
......
...@@ -94,7 +94,12 @@ func NewHandler(w http.ResponseWriter, r *http.Request) { ...@@ -94,7 +94,12 @@ func NewHandler(w http.ResponseWriter, r *http.Request) {
return return
} }
const credit = 5000 var credit int64
if session.User.Credits > 0 {
credit = session.User.Credits
} else {
credit = 5000
}
if session.User.Money < prod.Price*int64(amount)-credit { if session.User.Money < prod.Price*int64(amount)-credit {
errorMsg("Nincs elég egyenleged") errorMsg("Nincs elég egyenleged")
return return
......
static/images/cuba_libre.png

31 KiB

static/images/darknstormy.png

889 KiB

static/images/jager.png

389 KiB

static/images/long_island.png

166 KiB

static/images/mojito.png

214 KiB

static/images/screw_driver.png

26.3 KiB

static/images/tatratea.png

5.64 KiB

static/images/tequila_sunrise.png

33.1 KiB

static/images/unicum.png

33.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment