From 2e056aeaa85547e72b6a8588577f96d4b0231e24 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Thu, 18 Jan 2024 14:12:22 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_audit_center.go | 10 ++++++++++ app/admin/md/md_central_kitchen_for_school_order.go | 1 + .../svc/order/svc_central_kitchen_for_school_order.go | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/app/admin/hdl/hdl_audit_center.go b/app/admin/hdl/hdl_audit_center.go index 366f6ad..c4ebf02 100644 --- a/app/admin/hdl/hdl_audit_center.go +++ b/app/admin/hdl/hdl_audit_center.go @@ -43,6 +43,16 @@ func CentralKitchenForSchoolOrderRefundList(c *gin.Context) { "value": 2, }, }, + "order_by_name_list": []map[string]interface{}{ + { + "name": "按姓名升序", + "value": 1, + }, + { + "name": "按姓名降序", + "value": 2, + }, + }, "kind_list": []map[string]interface{}{ { "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast), diff --git a/app/admin/md/md_central_kitchen_for_school_order.go b/app/admin/md/md_central_kitchen_for_school_order.go index c1656f7..5e60e3c 100644 --- a/app/admin/md/md_central_kitchen_for_school_order.go +++ b/app/admin/md/md_central_kitchen_for_school_order.go @@ -24,6 +24,7 @@ type CentralKitchenForSchoolOrderRefundListReq struct { Phone string `json:"phone" label:"用户电话"` Name string `json:"name" label:"名称"` Memo string `json:"memo" label:"备注"` + OrderByName int `json:"order_by_name" label:"是否根据名称排序"` Kind int `json:"kind" label:"订餐类型"` State int `json:"state" label:"退款订单状态"` StartDate string `json:"start_date" label:"开始时间"` diff --git a/app/admin/svc/order/svc_central_kitchen_for_school_order.go b/app/admin/svc/order/svc_central_kitchen_for_school_order.go index 941bb7d..8d66ff1 100644 --- a/app/admin/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/admin/svc/order/svc_central_kitchen_for_school_order.go @@ -32,6 +32,12 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR if req.Name != "" { sess.And("user_identity.name like ?", "%"+req.Name+"%") } + if req.OrderByName == 1 { + sess.OrderBy("CONVERT(user_identity.name USING gbk) ASC") + } + if req.OrderByName == 2 { + sess.OrderBy("CONVERT(user_identity.name USING gbk) DESC") + } if req.Kind != 0 { sess.And("central_kitchen_for_school_user_with_day.kind = ?", req.Kind) }