package model

import (
	"time"
)

type CommunityTeamOrder struct {
	Id                 int       `json:"id" xorm:"not null pk autoincr INT(11)"`
	Uid                int       `json:"uid" xorm:"default 0 INT(11)"`
	StoreType          int       `json:"store_type" xorm:"default 0 comment('0官方自营店 1加盟店 2连锁店') INT(11)"`
	StoreUid           int       `json:"store_uid" xorm:"default 0 comment('门店用户id') INT(11)"`
	ParentUid          int       `json:"parent_uid" xorm:"default 0 comment('上级代理') INT(11)"`
	Num                int       `json:"num" xorm:"default 0 comment('') INT(11)"`
	CouponId           int       `json:"coupon_id" xorm:"default 0 comment('') INT(11)"`
	Address            string    `json:"address" xorm:"comment('详细地址') VARCHAR(255)"`
	Commission         string    `json:"commission" xorm:"default 0.00 comment('分佣(元)') DECIMAL(20,2)"`
	TableNum           string    `json:"table_num" xorm:"default 0.00 comment('分佣(元)') varchar(255)"`
	AgentCommission    string    `json:"agent_commission" xorm:"default 0.00 comment('分佣(元)') DECIMAL(20,2)"`
	PlatformCommission string    `json:"platform_commission" xorm:"default 0.00 comment('分佣(元)') DECIMAL(20,2)"`
	CreateAt           time.Time `json:"create_at" xorm:"DATETIME"`
	UpdateAt           time.Time `json:"update_at" xorm:"DATETIME"`
	CancelAt           time.Time `json:"cancel_at" xorm:"DATETIME"`
	BuyPhone           string    `json:"buy_phone" xorm:"VARCHAR(255)"`
	Phone              string    `json:"phone" xorm:"VARCHAR(255)"`
	BuyName            string    `json:"buy_name" xorm:"VARCHAR(255)"`
	State              int       `json:"state" xorm:"default 0 comment('0待付款 1已支付 2已提货') INT(11)"`
	PayAt              time.Time `json:"pay_at" xorm:"comment('付款时间') DATETIME"`
	ConfirmAt          time.Time `json:"confirm_at" xorm:"comment('提货时间') DATETIME"`
	Oid                int64     `json:"oid" xorm:"default 0 comment('主单号') BIGINT(20)"`
	Code               string    `json:"code" xorm:"comment('提货码') VARCHAR(255)"`
	Type               int       `json:"type" xorm:"default 0 comment('0自提 1外卖') INT(1)"`
	PayMethod          int       `json:"pay_method" xorm:"default 0 comment('1余额 2支付宝 3微信') INT(11)"`
	PayId              string    `json:"pay_id" xorm:"comment('第三方的支付id') VARCHAR(255)"`
	Amount             string    `json:"amount" xorm:"default 0.00 comment('总金额') DECIMAL(20,2)"`
	Memo               string    `json:"memo" xorm:"comment('备注') VARCHAR(255)"`
	TakeTime           time.Time `json:"take_time" xorm:"comment('预计提货时间') DATETIME"`
	MealNum            int       `json:"meal_num" xorm:"default 0 comment('餐具数量') INT(11)"`
	Coupon             string    `json:"coupon" xorm:"default 0.00 DECIMAL(10,2)"`
	Timer              string    `json:"timer" xorm:"comment('预计提货时间') VARCHAR(255)"`
	IsNow              int       `json:"is_now" xorm:"default 0 comment('是否立即提货') INT(1)"`
	StoreSettleAt      int       `json:"store_settle_at" xorm:"default 0 comment('') INT(11)"`
	SettleAt           int       `json:"settle_at" xorm:"default 0 comment('') INT(11)"`
	CommissionAt       int       `json:"commission_at" xorm:"default 0 comment('') INT(11)"`
}