作者 陈志颖

fix:空数组

@@ -326,6 +326,9 @@ func (employeeService *EmployeeService) ListEmployee(listEmployeeQuery *query.Li @@ -326,6 +326,9 @@ func (employeeService *EmployeeService) ListEmployee(listEmployeeQuery *query.Li
326 if err := transactionContext.CommitTransaction(); err != nil { 326 if err := transactionContext.CommitTransaction(); err != nil {
327 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 327 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
328 } 328 }
  329 + if len(employeesSpecific) == 0 {
  330 + employeesSpecific = []interface{}{}
  331 + }
329 return map[string]interface{}{ 332 return map[string]interface{}{
330 "count": count, 333 "count": count,
331 "employees": employeesSpecific, 334 "employees": employeesSpecific,
@@ -102,7 +102,7 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri @@ -102,7 +102,7 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri
102 if uid, ok := queryOptions["uid"]; ok && (uid != int64(0)) { 102 if uid, ok := queryOptions["uid"]; ok && (uid != int64(0)) {
103 query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid) 103 query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid)
104 } 104 }
105 - if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName != "") { 105 + if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName.(string) != "") {
106 query = query.Where(`(su_money_transaction_record.employee->>'employeeName')::text LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string))) 106 query = query.Where(`(su_money_transaction_record.employee->>'employeeName')::text LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string)))
107 } 107 }
108 if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) { 108 if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) {