作者 陈志颖

fix:修复现金池为空时,添加兑换素币清单报错问题

@@ -1079,7 +1079,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC @@ -1079,7 +1079,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC
1079 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1079 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1080 } 1080 }
1081 if len(cashPoolsFound) == 0 { 1081 if len(cashPoolsFound) == 0 {
1082 - return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(activityFound.CompanyId))) 1082 + return nil, application.ThrowError(application.RES_NO_FIND_ERROR, "当前现金池为空,请先投入现金")
1083 } 1083 }
1084 1084
1085 // 判断兑换活动的现金是否超过现金池未兑换现金 1085 // 判断兑换活动的现金是否超过现金池未兑换现金
@@ -69,7 +69,7 @@ func (repository *EmployeeRepository) FindOne(queryOptions map[string]interface{ @@ -69,7 +69,7 @@ func (repository *EmployeeRepository) FindOne(queryOptions map[string]interface{
69 if companyId, ok := queryOptions["companyId"]; ok { 69 if companyId, ok := queryOptions["companyId"]; ok {
70 query = query.Where("employee.company_id = ?", companyId) 70 query = query.Where("employee.company_id = ?", companyId)
71 } 71 }
72 - query = query.Where(`employee.status = ?`, 1) 72 + //query = query.Where(`employee.status = ?`, 1)
73 if err := query.First(); err != nil { 73 if err := query.First(); err != nil {
74 if err.Error() == "pg: no rows in result set" { 74 if err.Error() == "pg: no rows in result set" {
75 return nil, fmt.Errorf("没有此员工") 75 return nil, fmt.Errorf("没有此员工")
@@ -86,6 +86,8 @@ func (controller *EmployeeController) ListEmployee() { @@ -86,6 +86,8 @@ func (controller *EmployeeController) ListEmployee() {
86 listEmployeeQuery.CompanyId = companyId 86 listEmployeeQuery.CompanyId = companyId
87 employeeNameMatch := controller.GetString("employeeNameMatch") 87 employeeNameMatch := controller.GetString("employeeNameMatch")
88 listEmployeeQuery.EmployeeNameMatch = employeeNameMatch 88 listEmployeeQuery.EmployeeNameMatch = employeeNameMatch
  89 + status, _ := controller.GetInt("status")
  90 + listEmployeeQuery.Status = status
89 offset, _ := controller.GetInt("offset") 91 offset, _ := controller.GetInt("offset")
90 listEmployeeQuery.Offset = offset 92 listEmployeeQuery.Offset = offset
91 limit, _ := controller.GetInt("limit") 93 limit, _ := controller.GetInt("limit")