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.
39 lines
2.4 KiB
39 lines
2.4 KiB
package models
|
|
|
|
import (
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
"time"
|
|
)
|
|
|
|
const CustomerOrderTableName = TableNamePrefix + "customer_order"
|
|
|
|
type CustomerOrder struct {
|
|
Id int64 `json:"id" xorm:"pk autoincr BIGINT(20)"`
|
|
UserPrizeId int64 `json:"user_prize_id" xorm:"not null default 0 comment('用户奖品id') INT(11)"`
|
|
ActivityId int64 `json:"activity_id" xorm:"not null default 0 comment('主活动id') INT(11)"`
|
|
AreaId int64 `json:"area_id" xorm:"not null default 0 comment('地区id') BIGINT(20)"`
|
|
AreaName string `json:"area_name" xorm:"not null default('') comment('地区名字') VARCHAR(255)"`
|
|
RehearsalId int64 `json:"rehearsal_id" xorm:"not null default(0) comment('彩排id/0正式') BIGINT(20)"`
|
|
OutTradeNo string `json:"out_trade_no" xorm:"not null default('') comment('订单流水号') VARCHAR(255)"`
|
|
OrderEntryPersonId int64 `json:"order_enter_person_id" xorm:"not null default 0 comment('订单录入人员id') BIGINT(20)"`
|
|
OrderEntryPersonName string `json:"order_entry_person_name" xorm:"-"`
|
|
BuyerId int64 `json:"buyer_id" xorm:"not null default 0 comment('user表id') BIGINT(20)"`
|
|
User *User `json:"user" xorm:"-"`
|
|
GoodsId int64 `json:"goods_id" xorm:"not null default 0 comment('customer_goods表id') BIGINT(20)"`
|
|
Good *CustomerGoods `json:"good" xorm:"-"`
|
|
GoodsName string `json:"goods_name" xorm:"not null default('') comment('商品名字') VARCHAR(255)"`
|
|
TotalAmount float64 `json:"total_amount" xorm:"not null default 0.00 comment('订单总额') DECIMAL"`
|
|
OrderTime string `json:"order_time" xorm:"-"`
|
|
IsDelete bool `json:"is_delete" xorm:"not null default(0) comment('软删除') TINYINT(1)"`
|
|
CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"`
|
|
UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') DATETIME"`
|
|
}
|
|
|
|
func (t *CustomerOrder) TableName() string {
|
|
return CustomerOrderTableName
|
|
}
|
|
|
|
func (t *CustomerOrder) SoftDeleteById(id int64) (int64, error) {
|
|
t.IsDelete = true
|
|
return core.GetXormAuto().Id(id).Cols("is_delete").Update(t)
|
|
}
|