提交 bbf6663d authored 作者: mooncake's avatar mooncake

update

上级 a4765858
...@@ -202,7 +202,7 @@ func GetGinCtx(ctx context.Context) (*gin.Context, error) { ...@@ -202,7 +202,7 @@ func GetGinCtx(ctx context.Context) (*gin.Context, error) {
} }
func GetGinUID(c context.Context) xsf.ID { func GetGinUID(c context.Context) xsf.ID {
if val := c.Value(KeyCompanyID); val != nil { if val := c.Value(KeyUID); val != nil {
if v, ok := val.(xsf.ID); ok { if v, ok := val.(xsf.ID); ok {
return v return v
} }
......
...@@ -257,7 +257,11 @@ func otherSql(driver string, t *resolveSearchTag, condition Condition, qValue re ...@@ -257,7 +257,11 @@ func otherSql(driver string, t *resolveSearchTag, condition Condition, qValue re
if val != "" { if val != "" {
order, success := parseOrder(val) order, success := parseOrder(val)
if success { if success {
condition.SetOrder(order) if !strings.Contains(order, ",") && !strings.Contains(order, ".") {
condition.SetOrder(fmt.Sprintf("%s.%s", t.Table, order))
} else {
condition.SetOrder(order)
}
} else { } else {
switch strings.ToLower(qValue.Field(i).String()) { switch strings.ToLower(qValue.Field(i).String()) {
case "desc", "asc": case "desc", "asc":
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论