update
This commit is contained in:
@@ -51,9 +51,8 @@ func (a *app) add(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (a *app) edit(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
vars := r.URL.Query()
|
||||
id := convertor.QueryInt[int32](vars, "id", 0)
|
||||
vm := &systemmodel.User{}
|
||||
id := convertor.QueryInt[int32](r.URL.Query(), "id", 0)
|
||||
if id > 0 {
|
||||
if u, err := a.userService.Get(ctx, id); err == nil {
|
||||
vm = u
|
||||
@@ -110,13 +109,13 @@ func (a *app) list(w http.ResponseWriter, r *http.Request) {
|
||||
a.render.Render(ctx, w, user.List(ctx))
|
||||
case http.MethodPost:
|
||||
var q dto.SearchDto
|
||||
q.SearchTimeBegin, q.SearchTimeEnd = convertor.DefaultStartTimeAndEndTime(r.PostFormValue("timeBegin"), r.PostFormValue("timeEnd"))
|
||||
q.SearchStatus = convertor.ConvertInt(r.PostFormValue("status"), 9999)
|
||||
q.SearchTimeBegin, q.SearchTimeEnd = convertor.DefaultTime(r.PostFormValue("timeBegin"), r.PostFormValue("timeEnd"))
|
||||
q.SearchStatus = convertor.Int(r.PostFormValue("status"), 9999)
|
||||
q.SearchName = r.PostFormValue("name")
|
||||
q.SearchEmail = r.PostFormValue("email")
|
||||
q.SearchID = convertor.ConvertInt[int64](r.PostFormValue("id"), 0)
|
||||
q.Page = convertor.ConvertInt(r.PostFormValue("page"), 1)
|
||||
q.Rows = convertor.ConvertInt(r.PostFormValue("rows"), 10)
|
||||
q.SearchID = convertor.Int[int64](r.PostFormValue("id"), 0)
|
||||
q.Page = convertor.Int(r.PostFormValue("page"), 1)
|
||||
q.Rows = convertor.Int(r.PostFormValue("rows"), 10)
|
||||
res, count, err := a.userService.List(r.Context(), q)
|
||||
if err != nil {
|
||||
a.render.JSONErr(w, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user