正在显示
1 个修改的文件
包含
3 行增加
和
3 行删除
@@ -30,9 +30,9 @@ func (repository *EmployeeRepository) Save(employee *domain.Employee) (*domain.E | @@ -30,9 +30,9 @@ func (repository *EmployeeRepository) Save(employee *domain.Employee) (*domain.E | ||
30 | return employee, err | 30 | return employee, err |
31 | } | 31 | } |
32 | if _, err := tx.QueryOne( | 32 | if _, err := tx.QueryOne( |
33 | - pg.Scan(&employee.EmployeeId, &employee.CompanyId, &employee.EmployeeInfo.Uid, &employee.EmployeeInfo.EmployeeName, &employee.EmployeeInfo.EmployeeAccount, &employee.EmployeeInfo.EmployeeAvatarUrl, &employee.EmployeeInfo.IsPrincipal, &employee.SuMoney, &employee.Status, pg.Array(&employee.Permissions)), | ||
34 | - "INSERT INTO employees (id, company_id, uid, employee_name, employee_account, employee_avatar_url, is_principal, su_money, status, permissions) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, company_id, uid, employee_name, employee_account, employee_avatar_url, is_principal, su_money, status, permissions", | ||
35 | - employeeId, employee.CompanyId, employee.EmployeeInfo.Uid, employee.EmployeeInfo.EmployeeName, employee.EmployeeInfo.EmployeeAccount, employee.EmployeeInfo.EmployeeAvatarUrl, employee.EmployeeInfo.IsPrincipal, employee.SuMoney, employee.Status, pg.Array(employee.Permissions)); err != nil { | 33 | + pg.Scan(&employee.EmployeeId, &employee.CompanyId, &employee.EmployeeInfo.Uid, &employee.EmployeeInfo.EmployeeName, &employee.EmployeeInfo.EmployeeAccount, &employee.EmployeeInfo.EmployeeAvatarUrl, &employee.EmployeeInfo.IsPrincipal, &employee.SuMoney, &employee.Status, pg.Array(&employee.Permissions), &employee.CreateTime), |
34 | + "INSERT INTO employees (id, company_id, uid, employee_name, employee_account, employee_avatar_url, is_principal, su_money, status, permissions, create_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, company_id, uid, employee_name, employee_account, employee_avatar_url, is_principal, su_money, status, permissions, create_time", | ||
35 | + employeeId, employee.CompanyId, employee.EmployeeInfo.Uid, employee.EmployeeInfo.EmployeeName, employee.EmployeeInfo.EmployeeAccount, employee.EmployeeInfo.EmployeeAvatarUrl, employee.EmployeeInfo.IsPrincipal, employee.SuMoney, employee.Status, pg.Array(employee.Permissions), employee.CreateTime); err != nil { | ||
36 | return employee, err | 36 | return employee, err |
37 | } | 37 | } |
38 | } else { | 38 | } else { |
-
请 注册 或 登录 后发表评论