package models

type Pasture struct {
	PastureId   int64  `xorm:"pastureid"`
	PastureCode string `xorm:"pasture_code"`
	PastureName string `xorm:"pasture_name"`
	GroupsId    int64  `xorm:"groupsid"`
	User        string `xorm:"user"`
	Note        string `xorm:"note"`
	Enable      int32  `xorm:"enable"`
	Emp         string `xorm:"emp"`
	Address     string `xorm:"address"`
	Phone       string `xorm:"phone"`
	IsGroups    int32  `xorm:"isgroups"`
}

func (p *Pasture) TableName() string {
	return "pasture"
}

func NewPasture(pastureId int64, pastureName, address, managerUser, phone string) *Pasture {
	return &Pasture{
		PastureId:   pastureId,
		PastureCode: pastureName,
		PastureName: pastureName,
		GroupsId:    0,
		User:        managerUser,
		Note:        "",
		Enable:      1,
		Emp:         managerUser,
		Address:     address,
		Phone:       phone,
		IsGroups:    0,
	}
}