fix sql
This commit is contained in:
parent
e170de536a
commit
4077e19f34
@ -40,7 +40,7 @@ func GetAccount(account string) (acc *Account, err error) {
|
|||||||
// CreateAccount -
|
// CreateAccount -
|
||||||
func CreateAccount(account, password string) (acc *Account, err error) {
|
func CreateAccount(account, password string) (acc *Account, err error) {
|
||||||
acc = &Account{}
|
acc = &Account{}
|
||||||
err = x.Get(acc, `insert into "public"."account" ("account", "password", "ctime", "mtime") values ($1, $2, now(), now())`, account, password)
|
err = x.Get(acc, `insert into "public"."account" ("account", "password", "ctime", "mtime") values ($1, $2, now(), now()) returning *`, account, password)
|
||||||
if err == sql.ErrNoRows {
|
if err == sql.ErrNoRows {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user