commit
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package psql
|
||||
|
||||
import "github.com/shopspring/decimal"
|
||||
import (
|
||||
"kurumibot/database"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type Group struct {
|
||||
ID int
|
||||
@@ -13,8 +17,8 @@ type Group struct {
|
||||
MaxWaifus int
|
||||
}
|
||||
|
||||
// func GetGroupById(id int) (*Group, error) {
|
||||
// group := new(Group)
|
||||
// // err := Database.Get(group, "select * from groups where id=$1;", id)
|
||||
// return group, err
|
||||
// }
|
||||
func GetGroupById(id int) (*Group, error) {
|
||||
group := new(Group)
|
||||
tx := database.PostgresDatabase.First(group, "id = ?", id)
|
||||
return group, tx.Error
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ type User struct {
|
||||
WorkID int `gorm:"default:1"`
|
||||
Work *Work
|
||||
WorkTime time.Time
|
||||
|
||||
AutoID sql.NullInt64
|
||||
Auto *ShopAuto
|
||||
BusinessID sql.NullInt64
|
||||
@@ -32,6 +33,7 @@ type User struct {
|
||||
Maid *ShopMaid
|
||||
MinerID sql.NullInt64
|
||||
Miner *ShopMiner
|
||||
|
||||
IncomeTime time.Time
|
||||
BTC decimal.Decimal
|
||||
Invested decimal.Decimal
|
||||
|
||||
Reference in New Issue
Block a user