正在显示
4 个修改的文件
包含
23 行增加
和
0 行删除
@@ -133,6 +133,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR | @@ -133,6 +133,7 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR | ||
133 | Offset: request.PageIndex * request.PageSize, | 133 | Offset: request.PageIndex * request.PageSize, |
134 | Limit: request.PageSize, | 134 | Limit: request.PageSize, |
135 | SortByUpdateTime: domain.DESC, | 135 | SortByUpdateTime: domain.DESC, |
136 | + JoinWays: request.JoinWays, | ||
136 | }) | 137 | }) |
137 | if err != nil { | 138 | if err != nil { |
138 | return | 139 | return |
@@ -2,6 +2,7 @@ package domain | @@ -2,6 +2,7 @@ package domain | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" | 4 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" |
5 | + "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol/company" | ||
5 | "time" | 6 | "time" |
6 | ) | 7 | ) |
7 | 8 | ||
@@ -173,6 +174,7 @@ type DividendOrdersQueryOption struct { | @@ -173,6 +174,7 @@ type DividendOrdersQueryOption struct { | ||
173 | Offset int `json:"offset,omitempty"` | 174 | Offset int `json:"offset,omitempty"` |
174 | Limit int `json:"limit,omitempty"` | 175 | Limit int `json:"limit,omitempty"` |
175 | SortByUpdateTime string `json:"sortByUpdateTime,omitempty"` | 176 | SortByUpdateTime string `json:"sortByUpdateTime,omitempty"` |
177 | + JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型 | ||
176 | } | 178 | } |
177 | 179 | ||
178 | //买家 | 180 | //买家 |
@@ -7,6 +7,7 @@ import ( | @@ -7,6 +7,7 @@ import ( | ||
7 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models" | 7 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models" |
8 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction" | 8 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction" |
9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" | 9 | "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils" |
10 | + "strings" | ||
10 | "time" | 11 | "time" |
11 | ) | 12 | ) |
12 | 13 | ||
@@ -109,6 +110,20 @@ func (dao *OrderBaseDao) DividendOrders(option *domain.DividendOrdersQueryOption | @@ -109,6 +110,20 @@ func (dao *OrderBaseDao) DividendOrders(option *domain.DividendOrdersQueryOption | ||
109 | if option.EndTime > 0 { | 110 | if option.EndTime > 0 { |
110 | q.Where(`"order_base".create_time <?`, time.Unix(option.EndTime/1000, 0)) | 111 | q.Where(`"order_base".create_time <?`, time.Unix(option.EndTime/1000, 0)) |
111 | } | 112 | } |
113 | + if len(option.JoinWays) > 0 { | ||
114 | + var joinWays []int64 | ||
115 | + for i := 0; i < len(option.JoinWays); i++ { | ||
116 | + joinWays = append(joinWays, option.JoinWays[i].Type) | ||
117 | + } | ||
118 | + var filterJoinWays = strings.Builder{} | ||
119 | + for i := range joinWays { | ||
120 | + filterJoinWays.WriteString(fmt.Sprintf(` partner_category @>'{"id":%v}'`, joinWays[i])) | ||
121 | + if i != (len(joinWays) - 1) { | ||
122 | + filterJoinWays.WriteString(" or ") | ||
123 | + } | ||
124 | + } | ||
125 | + q.Where(filterJoinWays.String()) | ||
126 | + } | ||
112 | //if len(option.IsDisable) > 0 { | 127 | //if len(option.IsDisable) > 0 { |
113 | // value, _ := strconv.Atoi(option.IsDisable) | 128 | // value, _ := strconv.Atoi(option.IsDisable) |
114 | // q.Where(`"order_base".is_disable =?`, value) | 129 | // q.Where(`"order_base".is_disable =?`, value) |
1 | package protocol | 1 | package protocol |
2 | 2 | ||
3 | +import "gitlab.fjmaimaimai.com/mmm-go/partner/pkg/protocol/company" | ||
4 | + | ||
3 | const ( | 5 | const ( |
4 | BonusTotal = iota //0 累计分红 | 6 | BonusTotal = iota //0 累计分红 |
5 | BonusOutstanding //1 分红支出 | 7 | BonusOutstanding //1 分红支出 |
@@ -38,6 +40,9 @@ type DividendOrdersRequest struct { | @@ -38,6 +40,9 @@ type DividendOrdersRequest struct { | ||
38 | StartTime int64 `json:"startTime"` | 40 | StartTime int64 `json:"startTime"` |
39 | EndTime int64 `json:"endTime" valid:"Required"` | 41 | EndTime int64 `json:"endTime" valid:"Required"` |
40 | 42 | ||
43 | + // 合作类型(空或不传,即所有类型) | ||
44 | + JoinWays []*company.JoinWays `json:"joinWays"` | ||
45 | + | ||
41 | PageIndex int `json:"pageIndex,omitempty"` | 46 | PageIndex int `json:"pageIndex,omitempty"` |
42 | PageSize int `json:"pageSize,omitempty"` | 47 | PageSize int `json:"pageSize,omitempty"` |
43 | 48 |
-
请 注册 或 登录 后发表评论