Ver Fonte

#6680 【脚本+Go查询】付款方式顺序变更: 使用枚举的param1字段用于排序

deng.yinping há 9 meses atrás
pai
commit
7d31b61b81
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      models/sbyj.go

+ 3 - 1
models/sbyj.go

@@ -812,6 +812,7 @@ type MemberPayInfo struct {
 func (r *MemberPayInfo) calc() {}
 
 func (r *MemberPayInfo) buildSql() string {
+	// 使用枚举的param1字段用于排序
 	var sqlId utils.SQLVal = `
 		select t.userid, 
 		t.paymodel, 
@@ -819,8 +820,9 @@ func (r *MemberPayInfo) buildSql() string {
 		t.payqrcode 
 		from userpayinfo t
 		inner join useraccount ua on t.userid = ua.memberuserid
+		left join enumdicitem en on en.enumdiccode='paymodel' and en.enumitemname = t.paymodel
 		where ua.userid = %v
-		order by t.paymodel desc
+		order by en.param1, t.paymodel desc
 	`
 	sqlId.FormatParam(r.USERID)
 	return sqlId.String()