作者 tangxvhui

更新

  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +const (
  6 + OrderStatusReserve = iota + 1 //预定中
  7 + OrderStatusDeliverSome //部分发货
  8 + OrderStatusDeliverAll //全部发货
  9 +)
  10 +
  11 +const (
  12 + OrderReal = iota + 1 //实发订单
  13 + OrderIntention //意向订单
  14 +)
  15 +
  16 +//买家
  17 +type Buyer struct {
  18 + //买家姓名
  19 + BuyerName string `json:"buyerName"`
  20 + //联系方式
  21 + ContactInfo string `json:"contactInfo"`
  22 + //收获地址
  23 + ShippingAddress string `json:"shippingAddress"`
  24 +}
  25 +
  26 +type Order struct {
  27 + Id int64 `json:"id"`
  28 + //订单类型
  29 + OrderType int `json:"orderType"`
  30 + //订单编号
  31 + OrderCode string `json:"orderCode"`
  32 + //订单名称
  33 + OrderName string `json:"oderName"`
  34 + //订单状态
  35 + OrderStatus int `json:"orderStatus"`
  36 + //数量
  37 + OrderCount int `json:"orderCount"`
  38 + //实际数量
  39 + OrderActualCount int `json:"orderActualCount"`
  40 + //订单金额
  41 + OrderAmount int `json:"orderAmount"`
  42 + //实际订单金额
  43 + OrderActualAmount int `json:"orderActualAmount"`
  44 + //订单已支付分红金额(货款)
  45 + OrderPaymentAmount int `json:"orderPaymentAmount"`
  46 + //订单区域信息
  47 + OrderRegionInfo *RegionInfo `json:"orderRegionInfo"`
  48 + //买家
  49 + Buyer *Buyer `json:"buyer"`
  50 + //合伙人id
  51 + PartnerId int64 `json:"PartnerId"`
  52 + PartnerInfo *PartnerInfo `json:"partnerInfo"`
  53 + //合伙人分红百分比
  54 + PartnerBonusPercent float64 `json:"partnerBonusPercent"`
  55 + //业务员分红百分比
  56 + SalesmanBonusPercent float64 `json:"salesmanBonusPercent"`
  57 + //最后查看得时间
  58 + LastViewTime time.Time `json:"lastViewTime"`
  59 +}
1 package models 1 package models
2 2
3 -import "time" 3 +import (
  4 + "time"
  5 +
  6 + "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain"
  7 +)
4 8
5 type Order struct { 9 type Order struct {
6 tableName struct{} `pg:"order,alias:order"` 10 tableName struct{} `pg:"order,alias:order"`
@@ -24,9 +28,9 @@ type Order struct { @@ -24,9 +28,9 @@ type Order struct {
24 //订单已支付分红金额(货款) 28 //订单已支付分红金额(货款)
25 OrderPaymentAmount int 29 OrderPaymentAmount int
26 //订单区域信息 30 //订单区域信息
27 - OrderRegionInfo string 31 + OrderRegionInfo *domain.RegionInfo
28 //买家 32 //买家
29 - Buyer string 33 + Buyer *domain.Buyer
30 //合伙人id 34 //合伙人id
31 PartnerId int64 35 PartnerId int64
32 //合伙人分红百分比 36 //合伙人分红百分比
@@ -122,7 +122,7 @@ func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuer @@ -122,7 +122,7 @@ func (reponsitory AdminUserRepository) Find(queryOption domain.AdminUserFindQuer
122 err error 122 err error
123 adminuserReturn = make([]domain.AdminUser, 0) 123 adminuserReturn = make([]domain.AdminUser, 0)
124 ) 124 )
125 - query = query.Order("admin_user.id DESC") 125 + query = query.Order("admin_user.id DESC ")
126 err = query.Select() 126 err = query.Select()
127 if err != nil { 127 if err != nil {
128 return adminuserReturn, err 128 return adminuserReturn, err