From 7d06c6472f1acea6b2e49e7b8837bf555e94e219 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 07 五月 2024 16:21:06 +0800
Subject: [PATCH] fox

---
 controllers/worker_controller.go |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/controllers/worker_controller.go b/controllers/worker_controller.go
index 235786f..d22304e 100644
--- a/controllers/worker_controller.go
+++ b/controllers/worker_controller.go
@@ -77,7 +77,7 @@
 		util.ResponseFormat(c, code.RequestParamError, "鍚嶇О涓虹┖")
 		return
 	}
-	err = models.NewWorkerSearch().Create(&params)
+	err = models.NewWorkerSearch().Save(&params)
 	if err != nil {
 		util.ResponseFormat(c, code.RequestParamError, "鏇存柊澶辫触")
 		return
@@ -101,7 +101,7 @@
 		util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�")
 		return
 	}
-	workers, total, err := models.NewWorkerSearch().SetPage(params.Page, params.PageSize).Find()
+	workers, total, err := models.NewWorkerSearch().SetPage(params.Page, params.PageSize).SetKeyword(params.Keyword).SetOrder("updated_at desc").Find()
 	if err != nil {
 		util.ResponseFormat(c, code.RequestParamError, "鏌ヨ澶辫触")
 		return
@@ -114,7 +114,7 @@
 //	@Tags		鍛樺伐绠$悊/鍛樺伐淇℃伅
 //	@Summary	鍒犻櫎浜哄憳淇℃伅
 //	@Produce	application/json
-//	@Param		number	path		string			true	"id"
+//	@Param		id	path		string			true	"id"
 //	@Param     	Authorization	header string true "token"
 //	@Success	200		{object}	util.Response		"鎴愬姛"
 //	@Router		/api-jl/v1/worker/deleteWorkerInfo/{id} [delete]

--
Gitblit v1.8.0