互动
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.

32 lines
966 B

5 years ago
  1. package models
  2. import (
  3. "time"
  4. )
  5. const CustomerGoodsTableName = TableNamePrefix + "customer_goods"
  6. type CustomerGoods struct {
  7. Id int64 `json:"id"`
  8. ActivityId int64 `json:"activity_id"`
  9. GoodsPicUrl string `json:"goods_pic_url"`
  10. Name string `json:"name" description:"商品名字"`
  11. Qrcode string `json:"qrcode" xorm:"-"`
  12. Price float64 `json:"price" description:"价格"`
  13. Desc string `json:"desc" description:"介绍"`
  14. IsDelete bool `json:"is_delete" xorm:"default(0)"`
  15. CreatedAt time.Time `json:"created_at" xorm:"created"`
  16. UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
  17. }
  18. func (t *CustomerGoods) TableName() string {
  19. return CustomerGoodsTableName
  20. }
  21. func (t *CustomerGoods) Alias(name string) string {
  22. return AliasTableName(t, name)
  23. }
  24. //func (t *CustomerGoods) GetById(gid int64) (bool, error) {
  25. // return core.GetXormAuto().Where("is_delete=0 and id=?", gid).Get(t)
  26. //}