互动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.6 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import (
  3. "github.com/ouxuanserver/osmanthuswine/src/core"
  4. "time"
  5. )
  6. const OrderEntryPersonTableName = TableNamePrefix + "order_entry_person"
  7. type OrderEntryPerson struct {
  8. Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
  9. Name string `json:"name" xorm:"not null default('') comment('名字') VARCHAR(255)"`
  10. Account string `json:"account" xorm:"not null default('') comment('账号') VARCHAR(255)"`
  11. Password string `json:"password" xorm:"not null default('') comment('密码') VARCHAR(255)"`
  12. Pid int64 `json:"pid" xorm:"not null default 0 comment('主账号') VARCHAR(255)"`
  13. AreaId int64 `json:"area_id" xorm:"not null default 0 comment('地区id') BIGINT(20)"`
  14. AreaName string `json:"area_name" xorm:"-"`
  15. ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('主活动id') BIGINT(20)"`
  16. ActivityName string `json:"activity_name" xorm:"-"`
  17. Token string `json:"token" xorm:"-"`
  18. IsDelete bool `json:"-" xorm:"not null default(0) comment('软删除') TINYINT(1)"`
  19. CreatedAt time.Time `json:"-" xorm:"not null created comment('创建时间') DATETIME"`
  20. UpdatedAt time.Time `json:"-" xorm:"not null updated comment('更新时间') DATETIME"`
  21. }
  22. func (t *OrderEntryPerson) TableName() string {
  23. return OrderEntryPersonTableName
  24. }
  25. func (t *OrderEntryPerson) Auth(account, password, activityId interface{}) (bool, error) {
  26. return core.GetXormAuto().Where("is_delete=0 and account = ? and password = ? and activity_id = ?",
  27. account, password, activityId).Get(t)
  28. }