作者 yangfu

修改:去掉订单状态(开启,关闭)

... ... @@ -23,7 +23,7 @@ func Statistics(header *protocol.RequestHeader, request *protocol.DividendStatis
defer func() {
transactionContext.RollbackTransaction()
}()
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC, OrderType: domain.OrderReal, IsDisable: "0"}))
_, orderAll, e := OrderBaseResponsitory.Find(utils.ObjectJsonToMap(domain.OrderQueryOption{PartnerId: header.UserId, EndTime: time.Now(), SortByCreateTime: domain.DESC, OrderType: domain.OrderReal}))
if e != nil {
log.Error(e)
}
... ... @@ -105,11 +105,11 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR
rsp = &protocol.DividendOrdersResponse{List: make([]*protocol.DividendOrderListItem, 0)}
count, orders, err = OrderDao.DividendOrders(&domain.DividendOrdersQueryOption{
OrderType: domain.OrderReal,
PartnerId: header.UserId,
DetailAction: request.DetailAction,
DividendAction: request.DividendAction,
IsDisable: "0",
OrderType: domain.OrderReal,
PartnerId: header.UserId,
DetailAction: request.DetailAction,
DividendAction: request.DividendAction,
//IsDisable: "0",
StartTime: request.StartTime,
EndTime: request.EndTime,
Offset: request.PageIndex * request.PageSize,
... ...
... ... @@ -175,7 +175,7 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
Limit: request.PageSize,
Offset: request.PageSize * request.PageIndex,
SortByUpdateTime: domain.DESC,
IsDisable: "0",
//IsDisable: "0",
}
if request.StartTime > 0 {
queryOption.BeginTime = time.Unix(request.StartTime/1000, 0)
... ...
... ... @@ -53,6 +53,8 @@ type OrderBase struct {
PartnerBonusExpense float64
//是否关闭【0;否】【1:是】
IsDisable int8
//1:待支付分红 2:已支付分红
BonusStatus int8
//货物列表
OrderGood []*OrderGood
}
... ... @@ -67,8 +69,8 @@ func (m *OrderBase) Identify() interface{} {
//合伙人
//订单累计分红
func (m *OrderBase) OrderTotalBonus() float64 {
if m.UsePartnerBonus >= 0 {
return utils.Decimal(m.UsePartnerBonus)
if m.UseOrderCount >= 0 {
return utils.Decimal(m.UsePartnerBonus + m.PartnerBonusExpense)
}
return utils.Decimal(m.PlanPartnerBonus)
}
... ... @@ -120,16 +122,16 @@ func (m *OrderBase) IsRead() int {
}
type OrderQueryOption struct {
PartnerId int64 `json:"partnerId,omitempty"`
OrderType int `json:"orderType,omitempty"`
OrderStatus int `json:"orderStatus,omitempty"`
BeginTime time.Time `json:"beginTime,omitempty"`
EndTime time.Time `json:"endTime,omitempty"`
IsDisable string `json:"isDisable,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
SortByUpdateTime string `json:"sortByUpdateTime,omitempty"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
PartnerId int64 `json:"partnerId,omitempty"`
OrderType int `json:"orderType,omitempty"`
OrderStatus int `json:"orderStatus,omitempty"`
BeginTime time.Time `json:"beginTime,omitempty"`
EndTime time.Time `json:"endTime,omitempty"`
//IsDisable string `json:"isDisable,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
SortByUpdateTime string `json:"sortByUpdateTime,omitempty"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
}
type DividendOrdersQueryOption struct {
... ...
... ... @@ -11,7 +11,7 @@ type OrderStaticQuery struct {
EndTime int64 `json:"endTime,omitempty"`
OrderStatus int `json:"orderStatus,omitempty"`
OrderType int `json:"orderType,omitempty"`
IsDisable int `json:"isDisable,omitempty"`
//IsDisable int `json:"isDisable,omitempty"`
}
type DividendOrdersQuery struct {
... ...
... ... @@ -6,7 +6,6 @@ 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"
"strconv"
"time"
)
... ... @@ -35,7 +34,7 @@ func (dao *OrderBaseDao) OrderStatics(option *domain.OrderStaticQuery) (count in
if option.EndTime > 0 {
q.Where(`"order_base".create_time <?`, time.Unix(option.EndTime/1000, 0))
}
q.Where(`"order_base".is_disable =?`, 0)
//q.Where(`"order_base".is_disable =?`, 0)
err = q.Select(&count, &amount, &orderAmount)
if option.OrderType == domain.OrderIntention { //意向订单值只有 order_amount order_actual_amount还未赋值
amount = orderAmount
... ... @@ -61,10 +60,10 @@ 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.IsDisable) > 0 {
value, _ := strconv.Atoi(option.IsDisable)
q.Where(`"order_base".is_disable =?`, value)
}
//if len(option.IsDisable) > 0 {
// value, _ := strconv.Atoi(option.IsDisable)
// q.Where(`"order_base".is_disable =?`, value)
//}
if option.DividendAction == 0 { //累计分红
if option.DetailAction == 0 { //已收明细
q.Where(`"order_base".partner_bonus_has>0`)
... ...
... ... @@ -54,6 +54,8 @@ type OrderBase struct {
PartnerBonusExpense float64
//是否关闭【0;否】【1:是】
IsDisable int8
//1:待支付分红 2:已支付分红
BonusStatus int8
//货物列表
OrderGood []*OrderGood `pg:"fk:order_id"`
}
... ...
... ... @@ -79,7 +79,7 @@ func (repository *OrderBaseRepository) Find(queryOptions map[string]interface{})
SetWhere(`"order_base".order_type= ?`, "orderType").
SetWhere(`"order_base".create_time >= ?`, "beginTime").
SetWhere(`"order_base".create_time < ?`, "endTime").
SetWhere(`"order_base".is_disable = ?`, "isDisable").
//SetWhere(`"order_base".is_disable = ?`, "isDisable").
SetLimit().
SetOrder(`order_base.create_time`, "sortByCreateTime").
SetOrder(`order_base.update_time`, "sortByUpdateTime")
... ...