package models import ( "git.ouxuan.net/tommy/osmanthuswine/src/core" ) const ArchTableName = TableNamePrefix + "arch" type Arch struct { Model `xorm:"extends"` CustomerId int `json:"customer_id"` ActivityId int `json:"activity_id"` Date string `json:"date"` Name string `json:"name"` } 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) }