Commit 491c803b by keith

工单列表排序状态靠前

parent 12b00117
...@@ -114,7 +114,7 @@ func (r *WorkOrderRepository) GetWorkOrders(request models.WorkOrderPaginationDt ...@@ -114,7 +114,7 @@ func (r *WorkOrderRepository) GetWorkOrders(request models.WorkOrderPaginationDt
del := strconv.Itoa(request.Del) del := strconv.Itoa(request.Del)
var workOrders []models.WorkOrderDto var workOrders []models.WorkOrderDto
SQLSUB := "SELECT w.*,u.nickname AS u_nickname,a.nickname AS a_nickname,w.id AS i_d,w.uid AS u_i_d,w.tid AS t_i_d,w.cid AS c_i_d FROM work_order w LEFT JOIN (SELECT id, nickname FROM `user`) u ON w.uid = u.id LEFT JOIN (SELECT id, nickname FROM `admin`) a ON w.last_reply = a.id" SQLSUB := "SELECT w.*,u.nickname AS u_nickname,a.nickname AS a_nickname,w.id AS i_d,w.uid AS u_i_d,w.tid AS t_i_d,w.cid AS c_i_d FROM work_order w LEFT JOIN (SELECT id, nickname FROM `user`) u ON w.uid = u.id LEFT JOIN (SELECT id, nickname FROM `admin`) a ON w.last_reply = a.id"
SQL := "SELECT * FROM (" + SQLSUB + ") w WHERE `delete` = " + del + statusSQL + tidSQL + " ORDER BY create_at DESC, update_at DESC, status ASC" SQL := "SELECT * FROM (" + SQLSUB + ") w WHERE `delete` = " + del + statusSQL + tidSQL + " ORDER BY status ASC, create_at DESC, update_at DESC"
_, err := r.o.Raw(SQL+" LIMIT ? OFFSET ?", request.PageSize, (request.PageOn-1)*request.PageSize).QueryRows(&workOrders) _, err := r.o.Raw(SQL+" LIMIT ? OFFSET ?", request.PageSize, (request.PageOn-1)*request.PageSize).QueryRows(&workOrders)
if err != nil { if err != nil {
logs.Warn("GetWorkOrders get WorkOrders------------", err) logs.Warn("GetWorkOrders get WorkOrders------------", err)
......
...@@ -176,7 +176,7 @@ packages: ...@@ -176,7 +176,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "2.0.0" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment