作者 yangfu

分红管理列表

... ... @@ -2,10 +2,10 @@ package query
type ListDividendOrdersQuery struct {
// 合伙人类别
PartnerName string `json:"partnerName"`
OrderNumber string `json:"orderNumber"`
PageSize int `json:"pageSize"`
PageNumber int `json:"pageNumber"`
PartnerId string `json:"partnerId"`
SearchText string `json:"searchText"`
PageSize int `json:"pageSize"`
PageNumber int `json:"pageNumber"`
}
func (q *ListDividendOrdersQuery) ValidateQuery() error {
... ...
... ... @@ -164,11 +164,11 @@ func (OrderPaymentService *OrderPaymentService) ListDividendOrders(listOrderPaym
}
}()
if count, orders, err = OrderDao.GetDividendOrders(map[string]interface{}{
"orderCode": listOrderPaymentQuery.OrderNumber,
"partnerName": listOrderPaymentQuery.PartnerName,
"orderType": 1,
"offset": (listOrderPaymentQuery.PageNumber - 1) * listOrderPaymentQuery.PageSize,
"limit": listOrderPaymentQuery.PageSize,
"orderCode": listOrderPaymentQuery.SearchText,
"partnerId": listOrderPaymentQuery.PartnerId,
"orderType": 1,
"offset": (listOrderPaymentQuery.PageNumber - 1) * listOrderPaymentQuery.PageSize,
"limit": listOrderPaymentQuery.PageSize,
}); err != nil {
return 0, nil, lib.ThrowError(lib.INTERNAL_SERVER_ERROR, err.Error())
}
... ...
... ... @@ -57,8 +57,8 @@ func (dao *OrderDao) GetDividendOrders(options map[string]interface{}) (count in
if v, ok := options["orderType"]; ok {
q.Where(`"order".order_type=?`, v)
}
if v, ok := options["partnerName"]; ok && len(v.(string)) > 0 {
q.Where(`partner_info.partner_name like ?`, "%"+v.(string)+"%")
if v, ok := options["partnerId"]; ok && len(v.(string)) > 0 {
q.Where(`"order".partner_id =?`, v)
}
if v, ok := options["offset"]; ok {
q.Offset(v.(int))
... ...