Procházet zdrojové kódy

查主账号详情接口修改

zou.yingbin před 4 roky
rodič
revize
aa5fa2403e
4 změnil soubory, kde provedl 23 přidání a 11 odebrání
  1. 5 1
      docs/docs.go
  2. 5 1
      docs/swagger.json
  3. 4 1
      docs/swagger.yaml
  4. 9 8
      models/ermcpAccMgr.go

+ 5 - 1
docs/docs.go

@@ -3831,7 +3831,7 @@ var doc = `{
                 "parameters": [
                     {
                         "type": "integer",
-                        "description": "所属机构id, 现在表里id都为1, 不填默认查arearuserid=1的",
+                        "description": "所属机构id",
                         "name": "areauserid",
                         "in": "query"
                     }
@@ -20622,6 +20622,10 @@ var doc = `{
                     "description": "账号id",
                     "type": "string"
                 },
+                "accountname": {
+                    "description": "账号名称(taaccount表中的名称)",
+                    "type": "string"
+                },
                 "appid": {
                     "description": "AppID",
                     "type": "string"

+ 5 - 1
docs/swagger.json

@@ -3815,7 +3815,7 @@
                 "parameters": [
                     {
                         "type": "integer",
-                        "description": "所属机构id, 现在表里id都为1, 不填默认查arearuserid=1的",
+                        "description": "所属机构id",
                         "name": "areauserid",
                         "in": "query"
                     }
@@ -20606,6 +20606,10 @@
                     "description": "账号id",
                     "type": "string"
                 },
+                "accountname": {
+                    "description": "账号名称(taaccount表中的名称)",
+                    "type": "string"
+                },
                 "appid": {
                     "description": "AppID",
                     "type": "string"

+ 4 - 1
docs/swagger.yaml

@@ -8621,6 +8621,9 @@ definitions:
       accountid:
         description: 账号id
         type: string
+      accountname:
+        description: 账号名称(taaccount表中的名称)
+        type: string
       appid:
         description: AppID
         type: string
@@ -14379,7 +14382,7 @@ paths:
   /Ermcp/QueryTradeConfigTMP:
     get:
       parameters:
-      - description: 所属机构id, 现在表里id都为1, 不填默认查arearuserid=1的
+      - description: 所属机构id
         in: query
         name: areauserid
         type: integer

+ 9 - 8
models/ermcpAccMgr.go

@@ -245,6 +245,7 @@ type MainAccountInfo struct {
 	FCNAME           string `json:"fcname"  xorm:"'FCNAME'"`                     // 期货公司代码
 	ISMAIN           int32  `json:"ismain"  xorm:"'ISMAIN'"`                     // 是否主账号
 	RELATEDUSERID    int64  `json:"relateduserid"  xorm:"'RELATEDUSERID'"`       // 关联用户id
+	ACCOUNTNAME      string `json:"accountname"  xorm:"'ACCOUNTNAME'"`           // 账号名称(taaccount表中的名称)
 }
 
 func (r *MainAccountInfo) calc() {
@@ -252,8 +253,8 @@ func (r *MainAccountInfo) calc() {
 }
 
 func (r *MainAccountInfo) buildSql() string {
-	var sqlId utils.SQLVal = "select t.accountid," +
-		"       t.hedgeaccountcode," +
+	var sqlId utils.SQLVal = "select c.accountid," +
+		"       c.hedgeaccountcode," +
 		"       c.hedgeaccountpwd," +
 		"       c.authcode," +
 		"       c.appid," +
@@ -261,19 +262,19 @@ func (r *MainAccountInfo) buildSql() string {
 		"       c.fcid," +
 		"       f.fcname," +
 		"       ta.ismain," +
-		"       ta.relateduserid" +
-		"  from hedge_outtaaccount t" +
-		"  left join hedge_outmainconfig c" +
-		"    on t.accountid = c.accountid" +
+		"       ta.relateduserid," +
+		"       ta.accountname" +
+		"  from hedge_outmainconfig c" +
 		"  left join ERMCP_FuturesCompany f" +
 		"    on c.fcid = f.fcid" +
-		"  left join taaccount ta on t.accountid=ta.accountid" +
+		"  left join taaccount ta" +
+		"    on c.accountid = ta.accountid" +
 		" where 1 = 1"
 	if r.RELATEDUSERID > 0 {
 		sqlId.And("ta.relateduserid", r.RELATEDUSERID)
 	}
 	if len(r.ACCOUNTID) > 0 {
-		sqlId.And("t.ACCOUNTID", r.ACCOUNTID)
+		sqlId.And("c.ACCOUNTID", r.ACCOUNTID)
 	}
 	return sqlId.String()
 }