作者 陈志颖

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

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