package order import ( "github.com/beego/beego/v2/client/orm" "time" ) type CygxOrderAddReq struct { GoodsId int `description:"商品ID"` Source string `description:"资源(文章、活动)"` SourceId int `description:"资源ID"` } type CygxOrder struct { OrderID int `orm:"column(order_id);pk";comment:"订单id"` OrderCode string `comment:"订单编号"` OutTradeCode string `comment:"外部交易号"` PaymentType int `comment:"支付类型。取值范围:1微信支付,2支付宝支付。"` GoodsName string `comment:"商品名称"` GoodsID int `comment:"商品ID"` BuyerInvoice string `comment:"买家发票信息"` GoodsMoney float64 `comment:"商品总价"` OrderMoney float64 `comment:"订单总价"` Point int `comment:"订单消耗积分"` PointMoney float64 `comment:"订单消耗积分抵多少钱"` PayMoney float64 `comment:"订单实付金额"` RefundMoney float64 `comment:"订单退款金额"` OrderStatus int `comment:"订单状态,0:已取消、1:待支付、2:已支付、3:已退款"` PayTime time.Time `comment:"订单付款时间"` SourceID int `comment:"来源ID"` Source string `comment:"来源\n报告 :article\n活动 :activity"` SourceTitle string `comment:"来源名称,活动或者报告标题"` UserID int `comment:"用户ID"` Mobile string `comment:"手机号"` Email string `comment:"邮箱"` CompanyID int `comment:"公司ID"` CompanyName string `comment:"公司名称"` RealName string `comment:"用户实际名称"` SellerName string `comment:"所属销售"` CreateTime time.Time `comment:"创建时间"` ModifyTime time.Time `comment:"修改时间"` RegisterPlatform int `comment:"来源 1小程序,2:网页"` } // 添加 func AddCygxOrder(item *CygxOrder) (err error) { o := orm.NewOrm() _, err = o.Insert(item) return }