作者 陈志颖

fix:查询参数错误

... ... @@ -166,8 +166,8 @@ func (repository *ContractUndertakerFeedbackRepository) Find(queryOptions map[st
})
}
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -197,8 +197,8 @@ func (repository *CooperationApplicationRepository) Find(queryOptions map[string
}
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -142,8 +142,8 @@ func (repository *CooperationContractChangeLogRepository) Find(queryOptions map[
cooperationContractChangeLogs := make([]*domain.CooperationContractChangeLog, 0)
query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractChangeLogModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -167,8 +167,8 @@ func (repository *CooperationContractRelevantRepository) Find(queryOptions map[s
cooperationContractRelevants := make([]*domain.CooperationContractRelevant, 0)
query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractRelevantModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -800,8 +800,8 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in
query.Where("cooperation_contract_id in (?)", pg.In(cooperationContractIds))
}
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -182,8 +182,8 @@ func (repository *CooperationContractUndertakerRepository) Find(queryOptions map
cooperationContractUndertakers := make([]*domain.CooperationContractUndertaker, 0)
query := sqlbuilder.BuildQuery(tx.Model(&cooperationContractUndertakerModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -176,8 +176,8 @@ func (repository *CooperationModeRepository) Find(queryOptions map[string]interf
query.Where("org->>'orgName' like ?", fmt.Sprintf("%%%s%%", organizationName))
}
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -203,8 +203,8 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
query.Where("status =? ", v)
}
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -177,8 +177,8 @@ func (repository *CreditAccountRepository) Find(queryOptions map[string]interfac
creditAccounts := make([]*domain.CreditAccount, 0)
query := sqlbuilder.BuildQuery(tx.Model(&creditAccountModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -177,8 +177,8 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte
dividendsEstimates := make([]*domain.DividendsEstimate, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsEstimateModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -162,8 +162,8 @@ func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[strin
dividendsIncentivesRules := make([]*domain.DividendsIncentivesRule, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsIncentivesRuleModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -300,8 +300,8 @@ func (repository *DividendsOrderRepository) Find(queryOptions map[string]interfa
dividendsOrders := make([]*domain.DividendsOrder, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsOrderModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -307,8 +307,8 @@ func (repository *DividendsReturnedOrderRepository) Find(queryOptions map[string
dividendsReturnedOrders := make([]*domain.DividendsReturnedOrder, 0)
query := sqlbuilder.BuildQuery(tx.Model(&dividendsReturnedOrderModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -162,8 +162,8 @@ func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]in
moneyIncentivesRules := make([]*domain.MoneyIncentivesRule, 0)
query := sqlbuilder.BuildQuery(tx.Model(&moneyIncentivesRuleModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...
... ... @@ -157,8 +157,8 @@ func (repository *OrderGoodRepository) Find(queryOptions map[string]interface{})
orderGoods := make([]*domain.OrderGood, 0)
query := sqlbuilder.BuildQuery(tx.Model(&orderGoodModels), queryOptions)
offsetLimitFlag := true
if limit, ok := queryOptions["limit"]; ok {
offsetLimitFlag = limit.(bool)
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
}
if offsetLimitFlag {
query.SetOffsetAndLimit(20)
... ...