|
@@ -3,6 +3,7 @@ package sop_stage
|
|
|
import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
+ "wechat-api/ent"
|
|
|
|
|
|
"wechat-api/ent/predicate"
|
|
|
"wechat-api/ent/sopstage"
|
|
@@ -37,7 +38,9 @@ func (l *GetSopStageListLogic) GetSopStageList(req *types.SopStageListReq) (*typ
|
|
|
} else {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, fmt.Errorf("TaskID 不能为空"), req)
|
|
|
}
|
|
|
- data, err := l.svcCtx.DB.SopStage.Query().Where(predicates...).All(l.ctx)
|
|
|
+ data, err := l.svcCtx.DB.SopStage.Query().Where(predicates...).Order(
|
|
|
+ ent.Desc(sopstage.FieldIndexSort), ent.Desc(sopstage.FieldUpdatedAt),
|
|
|
+ ).All(l.ctx)
|
|
|
|
|
|
if err != nil {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|