pasture.go 882 B

1234567891011121314151617181920212223242526272829303132333435
  1. package models
  2. type Pasture struct {
  3. PastureId int64 `xorm:"pastureid"`
  4. PastureCode string `xorm:"pasture_code"`
  5. PastureName string `xorm:"pasture_name"`
  6. GroupsId int64 `xorm:"groupsid"`
  7. User string `xorm:"user"`
  8. Note string `xorm:"note"`
  9. Enable int32 `xorm:"enable"`
  10. Emp string `xorm:"emp"`
  11. Address string `xorm:"address"`
  12. Phone string `xorm:"phone"`
  13. IsGroups int32 `xorm:"isgroups"`
  14. }
  15. func (p *Pasture) TableName() string {
  16. return "pasture"
  17. }
  18. func NewPasture(pastureId int64, pastureName, address, managerUser, phone string) *Pasture {
  19. return &Pasture{
  20. PastureId: pastureId,
  21. PastureCode: pastureName,
  22. PastureName: pastureName,
  23. GroupsId: 0,
  24. User: managerUser,
  25. Note: "",
  26. Enable: 1,
  27. Emp: managerUser,
  28. Address: address,
  29. Phone: phone,
  30. IsGroups: 0,
  31. }
  32. }