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

38 lines
1.9 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. package models
  2. import "time"
  3. const CustomerGoodsTableName = TableNamePrefix + "customer_goods"
  4. type CustomerGoods struct {
  5. Id int64 `json:"id" xorm:"not null pk autoincr INT(11)"`
  6. IsDelete bool `json:"is_delete" xorm:"not null default 0 comment('是否删除') TINYINT(1)"`
  7. CreatedAt time.Time `json:"created_at" xorm:"created comment('创建时间') TIMESTAMP"`
  8. UpdatedAt time.Time `json:"updated_at" xorm:"not null default 'CURRENT_TIMESTAMP' updated comment('更新时间') TIMESTAMP"`
  9. ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('互动id') INT(11)"`
  10. AreaId int64 `json:"area_id" xorm:"not null default 0 comment('地区id') INT(11)"`
  11. GoodsPicUrl string `json:"goods_pic_url" xorm:"not null default '' comment('商品图片') VARCHAR(255)"`
  12. IsForceAdded int `json:"is_force_added" xorm:"not null default 0 comment('是否强制上架0不强制1强制') TINYINT(1)"`
  13. GoodType int `json:"good_type" xorm:"not null default 0 comment('商品类型0不需要邮寄1需要邮寄') TINYINT(1)"`
  14. FixedField string `json:"fixed_field" xorm:"not null default '' comment('固定不可改字段,|分隔') VARCHAR(255)"`
  15. Stock int `json:"stock" xorm:"not null default 0 comment('库存-1的时候无上限') INT(18)"`
  16. Name string `json:"name" xorm:"not null default '' comment('商品名称') VARCHAR(255)"`
  17. Price float64 `json:"price" xorm:"not null default '' comment('商品单价') DECIMAL(18,2)"`
  18. Desc string `json:"desc" xorm:"not null default '' comment('商品介绍') VARCHAR(255)"`
  19. // 无关变量
  20. Qrcode string `json:"qrcode" xorm:"-"`
  21. }
  22. func (t *CustomerGoods) TableName() string {
  23. return CustomerGoodsTableName
  24. }
  25. func (t *CustomerGoods) Alias(name string) string {
  26. return AliasTableName(t, name)
  27. }
  28. //func (t *CustomerGoods) GetById(gid int64) (bool, error) {
  29. // return core.GetXormAuto().Where("is_delete=0 and id=?", gid).Get(t)
  30. //}