Преглед изворни кода

1.查历史过滤isvaliddata=1
2.查顶级用户增加nickname

zou.yingbin пре 4 година
родитељ
комит
db35622a9b
5 измењених фајлова са 55 додато и 38 уклоњено
  1. 4 0
      docs/docs.go
  2. 4 0
      docs/swagger.json
  3. 3 0
      docs/swagger.yaml
  4. 40 34
      models/ermcp3.go
  5. 4 4
      models/wrTrade2.go

+ 4 - 0
docs/docs.go

@@ -22377,6 +22377,10 @@ var doc = `{
                     "description": "修改时间",
                     "type": "string"
                 },
+                "nickname": {
+                    "description": "昵称",
+                    "type": "string"
+                },
                 "parenttopuser": {
                     "description": "上级顶级机构 [092=0,1时,默认为1, 092=2时若自已为顶级,则填入自己,自己不为顶级,填入ParentUserID的\"ParentTopUser\"]",
                     "type": "string"

+ 4 - 0
docs/swagger.json

@@ -22361,6 +22361,10 @@
                     "description": "修改时间",
                     "type": "string"
                 },
+                "nickname": {
+                    "description": "昵称",
+                    "type": "string"
+                },
                 "parenttopuser": {
                     "description": "上级顶级机构 [092=0,1时,默认为1, 092=2时若自已为顶级,则填入自己,自己不为顶级,填入ParentUserID的\"ParentTopUser\"]",
                     "type": "string"

+ 3 - 0
docs/swagger.yaml

@@ -6093,6 +6093,9 @@ definitions:
       modifytime:
         description: 修改时间
         type: string
+      nickname:
+        description: 昵称
+        type: string
       parenttopuser:
         description: 上级顶级机构 [092=0,1时,默认为1, 092=2时若自已为顶级,则填入自己,自己不为顶级,填入ParentUserID的"ParentTopUser"]
         type: string

+ 40 - 34
models/ermcp3.go

@@ -2242,6 +2242,7 @@ type Ermcp3RootUserAccount struct {
 	SUBACCOUNTLEVEL  int32  `json:"subaccountlevel"  xorm:"SUBACCOUNTLEVEL"`   // 子账户层数
 	APPLYSRC         int32  `json:"applysrc"  xorm:"APPLYSRC"`                 // 申请来源 - 1:管理端 2:终端
 	AUDITSRC         int32  `json:"auditsrc"  xorm:"AUDITSRC"`                 // 审核来源 - 1:管理端 2:终端
+	NICKNAME         string `json:"nickname"  xorm:"'NICKNAME'"`               // 昵称
 }
 
 func (r *Ermcp3RootUserAccount) calc() {
@@ -2249,40 +2250,45 @@ func (r *Ermcp3RootUserAccount) calc() {
 }
 
 func (r *Ermcp3RootUserAccount) buildSql() string {
-	var sqlId utils.SQLVal = "SELECT t.ROOTUSERID," +
-		"       t.CANRECOMMEND," +
-		"       t.USERID," +
-		"       t.USERTYPE," +
-		"       t.MODIFYSTATUS," +
-		"       t.ACCOUNTNAME," +
-		"       t.PARENTUSERID," +
-		"       t.BROKER," +
-		"       t.SUBAREALEVELPATH," +
-		"       t.REFEREEUSERID," +
-		"       t.MEMBERUSERID," +
-		"       t.ACCOUNTSTATUS," +
-		"       t.RECKONACCOUNTID," +
-		"       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME," +
-		"       t.CREATORID," +
-		"       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
-		"       t.AUDITUSERID," +
-		"       t.AUDITREMARK," +
-		"       to_char(t.CANCELTIME, 'yyyy-mm-dd hh24:mi:ss') CANCELTIME," +
-		"       t.CANCELUSERID," +
-		"       to_char(t.MODIFYTIME, 'yyyy-mm-dd hh24:mi:ss') MODIFYTIME," +
-		"       t.MODIFIERID," +
-		"       t.MODIFYREMARK," +
-		"       t.MAXINVESTORNUM," +
-		"       t.HASAUTH," +
-		"       t.REFERCOUNT," +
-		"       t.REFERNUM," +
-		"       t.ISANONYMOUS," +
-		"       t.PARENTTOPUSER," +
-		"       t.SUBACCOUNTLEVEL," +
-		"       t.APPLYSRC," +
-		"       t.AUDITSRC" +
-		"  FROM USERACCOUNT t" +
-		" WHERE 1 = 1 and t.userid in(select rootuserid from useraccount where userid=%v)"
+	var sqlId utils.SQLVal = `
+SELECT t.ROOTUSERID,
+       t.CANRECOMMEND,
+       t.USERID,
+       t.USERTYPE,
+       t.MODIFYSTATUS,
+       t.ACCOUNTNAME,
+       t.PARENTUSERID,
+       t.BROKER,
+       t.SUBAREALEVELPATH,
+       t.REFEREEUSERID,
+       t.MEMBERUSERID,
+       t.ACCOUNTSTATUS,
+       t.RECKONACCOUNTID,
+       to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME,
+       t.CREATORID,
+       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME,
+       t.AUDITUSERID,
+       t.AUDITREMARK,
+       to_char(t.CANCELTIME, 'yyyy-mm-dd hh24:mi:ss') CANCELTIME,
+       t.CANCELUSERID,
+       to_char(t.MODIFYTIME, 'yyyy-mm-dd hh24:mi:ss') MODIFYTIME,
+       t.MODIFIERID,
+       t.MODIFYREMARK,
+       t.MAXINVESTORNUM,
+       t.HASAUTH,
+       t.REFERCOUNT,
+       t.REFERNUM,
+       t.ISANONYMOUS,
+       t.PARENTTOPUSER,
+       t.SUBACCOUNTLEVEL,
+       t.APPLYSRC,
+       t.AUDITSRC,
+       u.nickname
+  FROM USERACCOUNT t
+  LEFT JOIN USERINFO u on t.userid=u.userid
+ WHERE 1 = 1
+   and t.userid in (select rootuserid from useraccount where userid = %v)
+`
 	sqlId.FormatParam(r.USERID)
 	return sqlId.String()
 }

+ 4 - 4
models/wrTrade2.go

@@ -871,7 +871,7 @@ select t.HASWR,
     on t.wrtradeorderid = mr.wrtradeorderid
   left join taaccount ta
     on t.accountid = ta.accountid
- where t.WRTRADETYPE = 1 and t.WRTRADEORDERSTATUS not in(2)
+ where t.WRTRADETYPE = 1 and t.WRTRADEORDERSTATUS not in(2) and t.isvaliddata=1
 `
 	sqlId.And("t.USERID", r.USERID)
 	sqlId.And("t.haswr", r.HASWR)
@@ -1031,7 +1031,7 @@ func (r *WrTradeDetail) buildSqlHis() string {
 		"  left join taaccount ta1 on t.accountid=ta1.accountid" +
 		"  left join taaccount ta2 on t.matchaccountid=ta2.accountid" +
 		"  left join useraccount u2 on ta2.userid=u2.userid" +
-		"  where 1=1"
+		"  where 1=1 and t.isvaliddata=1"
 	sqlId.And("ta1.userid", r.USERID)
 	sqlId.And("t.haswr", r.HASWR)
 	sqlId.AndEx("t.marketid", r.MARKETID, r.MARKETID > 0)
@@ -2960,7 +2960,7 @@ select t.xgoodsid,
     on w.wrstandardid = wd.wrstandardid
   left join warehouseinfo h on w.warehouseid=h.autoid
   left join enumdicitem e on wd.unitid=e.enumitemname and e.enumdiccode='goodsunit'
- where 1 = 1
+ where 1 = 1 and t.isvaliddata = 1
 `
 	sqlId.AndEx("u.userid", r.USERID, r.USERID > 0)
 	sqlId.AndEx("t.accountid", r.ACCOUNTID, r.ACCOUNTID > 0)
@@ -3865,7 +3865,7 @@ SELECT to_char(t.WRBARGAINID) WRBARGAINID,
   LEFT JOIN HIS_WRTRADE_ORDERDETAIL o on t.wrtradeorderid=o.wrtradeorderid
   LEFT JOIN tmp on o.wrfactortypeid=tmp.wrfactortypeid
   LEFT JOIN PERFORMANCEPLANTEMPLATE p on o.performancetemplateid=p.autoid
- WHERE 1 = 1 
+ WHERE 1 = 1 and t.isvaliddata = 1
 `
 	sqlId.AndEx("t.userid", r.USERID, r.USERID > 0)
 	sqlId.AndEx("t.matchuserid", r.MATCHUSERID, r.MATCHUSERID > 0)