update
This commit is contained in:
+7
-6
@@ -6,11 +6,11 @@ import (
|
||||
|
||||
// Account - table
|
||||
type Account struct {
|
||||
ID string `db:"id"`
|
||||
Account string `db:"account"`
|
||||
Password string `db:"password"`
|
||||
Ctime time.Time `db:"ctime"`
|
||||
Mtime time.Time `db:"mtime"`
|
||||
ID string `db:"id" cc:"id"`
|
||||
Account string `db:"account" cc:"account"`
|
||||
Password string `db:"password" cc:"password"`
|
||||
Ctime time.Time `db:"ctime" cc:"ctime"`
|
||||
Mtime time.Time `db:"mtime" cc:"ctime"`
|
||||
}
|
||||
|
||||
// GetAllAccount -
|
||||
@@ -24,7 +24,8 @@ func GetAllAccount() (accs []Account, err error) {
|
||||
|
||||
// GetAccount -
|
||||
func GetAccount(account string) (acc *Account, err error) {
|
||||
err = x.Select(acc, `select * from "public"."account" where "account" = $1`, account)
|
||||
acc = &Account{}
|
||||
err = x.Get(acc, `select * from "public"."account" where "account" = $1`, account)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user