|
|
@@ -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()
|
|
|
}
|