fix: get&set session

This commit is contained in:
email
2022-02-04 00:56:44 +08:00
parent d661134b03
commit a8f0c9a7b1
6 changed files with 62 additions and 29 deletions

View File

@@ -124,7 +124,7 @@ func patchUser(db *DB, patch *api.UserPatch) (*api.User, error) {
}
func findUserList(db *DB, find *api.UserFind) ([]*api.User, error) {
where, args := []string{}, []interface{}{}
where, args := []string{"1 = 1"}, []interface{}{}
if v := find.Id; v != nil {
where, args = append(where, "id = ?"), append(args, *v)
@@ -142,7 +142,7 @@ func findUserList(db *DB, find *api.UserFind) ([]*api.User, error) {
name,
password,
open_id,
created_ts
created_ts,
updated_ts
FROM user
WHERE `+strings.Join(where, " AND "),
@@ -164,6 +164,7 @@ func findUserList(db *DB, find *api.UserFind) ([]*api.User, error) {
&user.CreatedTs,
&user.UpdatedTs,
); err != nil {
fmt.Println(err)
return nil, FormatError(err)
}