package models import ( "github.com/ouxuanserver/osmanthuswine/src/core" "time" ) const ArchTableName = TableNamePrefix + "arch" type Arch struct { Id int `json:"id" xorm:"not null pk INT(11)"` CustomerId int `json:"customer_id"` ActivityId int `json:"activity_id"` Date string `json:"date"` Name string `json:"name"` IsDelete int `json:"is_delete"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (t *Arch) TableName() string { return ArchTableName } func (t *Arch) Count(activityId interface{}) (int64, error) { return core.GetXormAuto().Where("is_delete=0 and activity_id=?", activityId).Count(t) }