|
|
@@ -14,7 +14,7 @@ import (
|
|
|
"mtp2_if/utils"
|
|
|
)
|
|
|
|
|
|
-// 客户资料结构
|
|
|
+// ErmcpUserModel 客户资料结构
|
|
|
type ErmcpUserModel struct {
|
|
|
USERID int `json:"userid" xorm:"'USERID'"` // 用户ID
|
|
|
MEMBERUSERID int `json:"memberuserid" xorm:"'MEMBERUSERID'"` // 所属机构ID
|
|
|
@@ -35,6 +35,8 @@ type ErmcpUserModel struct {
|
|
|
PROVINCEID int32 `json:"provinceid" xorm:"'PROVINCEID'"` // 省
|
|
|
CITYID int32 `json:"cityid" xorm:"'CITYID'"` // 市
|
|
|
CREATETIME string `json:"createtime" xorm:"'CREATETIME'"` // 创建时间
|
|
|
+ MODIFYTIME string `json:"modifytime" xorm:"'MODIFYTIME'"` // 修改时间
|
|
|
+ AUDITTIME string `json:"audittime" xorm:"'AUDITTIME'"` // 审核时间
|
|
|
}
|
|
|
|
|
|
func (r *ErmcpUserModel) buildWskhSql(accStatus string) string {
|
|
|
@@ -55,14 +57,17 @@ func (r *ErmcpUserModel) buildWskhSql(accStatus string) string {
|
|
|
" t.countryid," +
|
|
|
" t.provinceid," +
|
|
|
" to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
|
|
|
- " t.cityid" +
|
|
|
+ " t.cityid," +
|
|
|
+ " to_char(t.modifiedtime,'yyyy-mm-dd hh24:mi:ss') modifytime," +
|
|
|
+ " to_char(t.auditime,'yyyy-mm-dd hh24:mi:ss') audittime" +
|
|
|
" from wskh_userinfo t" +
|
|
|
" left join enumdicitem e" +
|
|
|
" on t.cardtype = e.enumitemname" +
|
|
|
" and e.enumdiccode = 'certificatetype'" +
|
|
|
" where t.userstate in (%v)" +
|
|
|
" and t.usertype = 6" +
|
|
|
- " and t.memberareaid = %v"
|
|
|
+ " and t.memberareaid = %v" +
|
|
|
+ " order by t.modifiedtime desc"
|
|
|
return fmt.Sprintf(str, accStatus, r.MEMBERUSERID)
|
|
|
}
|
|
|
|
|
|
@@ -84,6 +89,8 @@ func (r *ErmcpUserModel) buildSql(accStatus string) string {
|
|
|
" u.countryid," +
|
|
|
" u.provinceid," +
|
|
|
" to_char(t.createtime,'yyyy-mm-dd hh24:mi:ss') createtime," +
|
|
|
+ " to_char(t.modifytime,'yyyy-mm-dd hh24:mi:ss') modifytime," +
|
|
|
+ " to_char(t.audittime,'yyyy-mm-dd hh24:mi:ss') audittime," +
|
|
|
" u.cityid" +
|
|
|
" from useraccount t" +
|
|
|
" left join userinfo u" +
|
|
|
@@ -94,6 +101,13 @@ func (r *ErmcpUserModel) buildSql(accStatus string) string {
|
|
|
" where t.usertype = 6" +
|
|
|
" and t.accountstatus in (%v)" +
|
|
|
" and t.memberuserid = %v"
|
|
|
+ // 查正常状态,按审核时间排序
|
|
|
+ if accStatus == "4" {
|
|
|
+ str += " order by t.audittime desc"
|
|
|
+ } else if accStatus == "6" {
|
|
|
+ // 停用状态按修改时间排序
|
|
|
+ str += " order by t.modifytime desc"
|
|
|
+ }
|
|
|
|
|
|
return fmt.Sprintf(str, accStatus, r.MEMBERUSERID)
|
|
|
}
|