作者 陈志颖

fix:空数组

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