@@ -43,6 +43,16 @@ func CentralKitchenForSchoolOrderRefundList(c *gin.Context) { | |||||
"value": 2, | "value": 2, | ||||
}, | }, | ||||
}, | }, | ||||
"order_by_name_list": []map[string]interface{}{ | |||||
{ | |||||
"name": "按姓名升序", | |||||
"value": 1, | |||||
}, | |||||
{ | |||||
"name": "按姓名降序", | |||||
"value": 2, | |||||
}, | |||||
}, | |||||
"kind_list": []map[string]interface{}{ | "kind_list": []map[string]interface{}{ | ||||
{ | { | ||||
"name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast), | "name": enum.CentralKitchenForSchoolUserWithDayKind.String(enum.CentralKitchenForSchoolUserWithDayKindForBreakfast), | ||||
@@ -24,6 +24,7 @@ type CentralKitchenForSchoolOrderRefundListReq struct { | |||||
Phone string `json:"phone" label:"用户电话"` | Phone string `json:"phone" label:"用户电话"` | ||||
Name string `json:"name" label:"名称"` | Name string `json:"name" label:"名称"` | ||||
Memo string `json:"memo" label:"备注"` | Memo string `json:"memo" label:"备注"` | ||||
OrderByName int `json:"order_by_name" label:"是否根据名称排序"` | |||||
Kind int `json:"kind" label:"订餐类型"` | Kind int `json:"kind" label:"订餐类型"` | ||||
State int `json:"state" label:"退款订单状态"` | State int `json:"state" label:"退款订单状态"` | ||||
StartDate string `json:"start_date" label:"开始时间"` | StartDate string `json:"start_date" label:"开始时间"` | ||||
@@ -32,6 +32,12 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR | |||||
if req.Name != "" { | if req.Name != "" { | ||||
sess.And("user_identity.name like ?", "%"+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 { | if req.Kind != 0 { | ||||
sess.And("central_kitchen_for_school_user_with_day.kind = ?", req.Kind) | sess.And("central_kitchen_for_school_user_with_day.kind = ?", req.Kind) | ||||
} | } | ||||