...
|
...
|
@@ -7,6 +7,7 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/models"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/pg/transaction"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/infrastructure/utils"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -109,6 +110,20 @@ func (dao *OrderBaseDao) DividendOrders(option *domain.DividendOrdersQueryOption |
|
|
if option.EndTime > 0 {
|
|
|
q.Where(`"order_base".create_time <?`, time.Unix(option.EndTime/1000, 0))
|
|
|
}
|
|
|
if len(option.JoinWays) > 0 {
|
|
|
var joinWays []int64
|
|
|
for i := 0; i < len(option.JoinWays); i++ {
|
|
|
joinWays = append(joinWays, option.JoinWays[i].Type)
|
|
|
}
|
|
|
var filterJoinWays = strings.Builder{}
|
|
|
for i := range joinWays {
|
|
|
filterJoinWays.WriteString(fmt.Sprintf(` partner_category @>'{"id":%v}'`, joinWays[i]))
|
|
|
if i != (len(joinWays) - 1) {
|
|
|
filterJoinWays.WriteString(" or ")
|
|
|
}
|
|
|
}
|
|
|
q.Where(filterJoinWays.String())
|
|
|
}
|
|
|
//if len(option.IsDisable) > 0 {
|
|
|
// value, _ := strconv.Atoi(option.IsDisable)
|
|
|
// q.Where(`"order_base".is_disable =?`, value)
|
...
|
...
|
|