package model

import (
	"time"
)

type FinUserFlow struct {
	Id           int64     `json:"id" xorm:"pk autoincr comment('流水编号') BIGINT(20)"`
	Uid          int       `json:"uid" xorm:"not null default 0 comment('用户id') INT(11)"`
	Type         int       `json:"type" xorm:"not null default 0 comment('0收入,1支出') TINYINT(1)"`
	Amount       string    `json:"amount" xorm:"not null default 0.0000 comment('变动金额') DECIMAL(11,4)"`
	BeforeAmount string    `json:"before_amount" xorm:"not null default 0.0000 comment('变动前金额') DECIMAL(11,4)"`
	AfterAmount  string    `json:"after_amount" xorm:"not null default 0.0000 comment('变动后金额') DECIMAL(11,4)"`
	SysFee       string    `json:"sys_fee" xorm:"not null default 0.0000 comment('手续费') DECIMAL(11,4)"`
	PaymentType  int       `json:"payment_type" xorm:"not null default 1 comment('1支付宝,2微信.3手动转账') TINYINT(1)"`
	OrdType      string    `json:"ord_type" xorm:"not null default '' comment('订单类型taobao,jd,pdd,vip,suning,kaola,own自营,withdraw提现') VARCHAR(20)"`
	OrdId        string    `json:"ord_id" xorm:"not null default '' comment('对应订单编号') VARCHAR(50)"`
	OrdTitle     string    `json:"ord_title" xorm:"not null default '' comment('订单标题') VARCHAR(50)"`
	OrdAction    int       `json:"ord_action" xorm:"not null default 0 comment('10自购,11推广,12团队,20提现,21消费') TINYINT(2)"`
	OrdTime      int       `json:"ord_time" xorm:"not null default 0 comment('下单时间or提现时间') INT(11)"`
	OrdDetail    string    `json:"ord_detail" xorm:"not null default '' comment('记录商品ID或提现账号') VARCHAR(50)"`
	ExpectedTime string    `json:"expected_time" xorm:"not null default '0' comment('预期到账时间,字符串用于直接显示,结算后清除内容') VARCHAR(30)"`
	State        int       `json:"state" xorm:"not null default 1 comment('1未到账,2已到账') TINYINT(1)"`
	Memo         string    `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(2000)"`
	OtherId      int64     `json:"other_id" xorm:"not null default 0 comment('其他关联订单,具体根据订单类型判断') BIGINT(20)"`
	AliOrdId     string    `json:"ali_ord_id" xorm:"default '' comment('支付宝订单号') VARCHAR(128)"`
	ExtendType   int       `json:"extend_type" xorm:"not null default 1 comment('') TINYINT(1)"`
	CreateAt     time.Time `json:"create_at" xorm:"created not null default CURRENT_TIMESTAMP comment('创建时间') TIMESTAMP"`
	UpdateAt     time.Time `json:"update_at" xorm:"updated not null default CURRENT_TIMESTAMP comment('更新时间') TIMESTAMP"`
}