order.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package order
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxOrderAddReq struct {
  7. GoodsId int `description:"商品ID"`
  8. Source string `description:"资源(文章、活动)"`
  9. SourceId int `description:"资源ID"`
  10. }
  11. type CygxOrder struct {
  12. OrderID int `orm:"column(order_id);pk";comment:"订单id"`
  13. OrderCode string `comment:"订单编号"`
  14. OutTradeCode string `comment:"外部交易号"`
  15. PaymentType int `comment:"支付类型。取值范围:1微信支付,2支付宝支付。"`
  16. GoodsName string `comment:"商品名称"`
  17. GoodsID int `comment:"商品ID"`
  18. BuyerInvoice string `comment:"买家发票信息"`
  19. GoodsMoney float64 `comment:"商品总价"`
  20. OrderMoney float64 `comment:"订单总价"`
  21. Point int `comment:"订单消耗积分"`
  22. PointMoney float64 `comment:"订单消耗积分抵多少钱"`
  23. PayMoney float64 `comment:"订单实付金额"`
  24. RefundMoney float64 `comment:"订单退款金额"`
  25. OrderStatus int `comment:"订单状态,0:已取消、1:待支付、2:已支付、3:已退款"`
  26. PayTime time.Time `comment:"订单付款时间"`
  27. SourceID int `comment:"来源ID"`
  28. Source string `comment:"来源\n报告 :article\n活动 :activity"`
  29. SourceTitle string `comment:"来源名称,活动或者报告标题"`
  30. UserID int `comment:"用户ID"`
  31. Mobile string `comment:"手机号"`
  32. Email string `comment:"邮箱"`
  33. CompanyID int `comment:"公司ID"`
  34. CompanyName string `comment:"公司名称"`
  35. RealName string `comment:"用户实际名称"`
  36. SellerName string `comment:"所属销售"`
  37. CreateTime time.Time `comment:"创建时间"`
  38. ModifyTime time.Time `comment:"修改时间"`
  39. RegisterPlatform int `comment:"来源 1小程序,2:网页"`
  40. }
  41. // 添加
  42. func AddCygxOrder(item *CygxOrder) (err error) {
  43. o := orm.NewOrm()
  44. _, err = o.Insert(item)
  45. return
  46. }