作者 陈志颖

fix:修改订单列表和分红列表排序方式

... ... @@ -132,7 +132,8 @@ func OrderList(header *protocol.RequestHeader, request *protocol.DividendOrdersR
EndTime: request.EndTime,
Offset: request.PageIndex * request.PageSize,
Limit: request.PageSize,
SortByUpdateTime: domain.DESC,
//SortByUpdateTime: domain.DESC,
SortByCreateTime: domain.DESC,
JoinWays: request.JoinWays,
})
if err != nil {
... ...
... ... @@ -197,7 +197,8 @@ func List(header *protocol.RequestHeader, request *protocol.OrderListRequest) (r
queryOption := &domain.OrderQueryOption{
Limit: request.PageSize,
Offset: request.PageSize * request.PageIndex,
SortByUpdateTime: domain.DESC,
//SortByUpdateTime: domain.DESC,
SortByCreateTime: domain.DESC,
PartnerId: request.PartnerId,
PartnerCategoryId: request.JoinWay,
OrderType: request.OrderType,
... ...
... ... @@ -2,11 +2,11 @@ package constant
import "os"
var POSTGRESQL_DB_NAME = "partner_dev" //partner
var POSTGRESQL_USER = "postgres" //
var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123
var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1
var POSTGRESQL_PORT = "31543" //5432
var POSTGRESQL_DB_NAME = "partner_dev" //partner_test/partner_dev
var POSTGRESQL_USER = "postgres" //postgres
var POSTGRESQL_PASSWORD = "eagle1010" //pgsql@123/1993618jack
var POSTGRESQL_HOST = "114.55.200.59" //127.0.0.1/114.55.200.59
var POSTGRESQL_PORT = "31543" //5432/31543
var DISABLE_CREATE_TABLE = true
var DISABLE_SQL_GENERATE_PRINT = false
... ...
... ... @@ -174,6 +174,7 @@ type DividendOrdersQueryOption struct {
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
SortByUpdateTime string `json:"sortByUpdateTime,omitempty"`
SortByCreateTime string `json:"sortByCreateTime,omitempty"`
JoinWays []*company.JoinWays `json:"joinWays,omitempty"` // 合伙类型
}
... ...
... ... @@ -144,7 +144,11 @@ func (dao *OrderBaseDao) DividendOrders(option *domain.DividendOrdersQueryOption
q.Offset(option.Offset)
}
if len(option.SortByUpdateTime) > 0 {
q.Order(fmt.Sprintf("order_base.id %v", option.SortByUpdateTime))
//q.Order(fmt.Sprintf("order_base.id %v", option.SortByUpdateTime))
q.Order(fmt.Sprintf("order_base.update_time %v", option.SortByUpdateTime))
}
if len(option.SortByCreateTime) > 0 {
q.Order(fmt.Sprintf("order_base.create_time %v", option.SortByCreateTime))
}
count, err = q.Distinct().SelectAndCount()
for i := range orders {
... ...