|
|
@@ -713,6 +713,7 @@ type QhjBankAccountSign struct {
|
|
|
NETADDR string `json:"netaddr" xorm:"NETADDR"` // 调转网址
|
|
|
UPDATETIME string `json:"updatetime" xorm:"UPDATETIME"` // 更新时间(签解约更新时间)
|
|
|
RELATEDUSERID int64 `json:"relateduserid" xorm:"'RELATEDUSERID'"` // 关联使用者userid
|
|
|
+ BANKNAME string `json:"bankname" xorm:"'BANKNAME'"` // 签约银行名称
|
|
|
}
|
|
|
|
|
|
func (r *QhjBankAccountSign) calc() {
|
|
|
@@ -753,11 +754,14 @@ func (r *QhjBankAccountSign) buildSql() string {
|
|
|
" to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
|
|
|
" t.APPLYEXCHTICKET," +
|
|
|
" ta.accountid," +
|
|
|
- " ta.relateduserid" +
|
|
|
+ " ta.relateduserid," +
|
|
|
+ " b.bankname" +
|
|
|
" FROM BANK_ACCOUNTSIGN t" +
|
|
|
" INNER JOIN TAACCOUNT ta" +
|
|
|
" on t.accountcode = to_char(ta.accountid)" +
|
|
|
- " WHERE 1 = 1 and ta.taaccounttype = 2"
|
|
|
+ " LEFT JOIN BANK_BANKINFO b on t.bankid=b.bankid" +
|
|
|
+ " WHERE 1 = 1" +
|
|
|
+ " and ta.taaccounttype = 2"
|
|
|
sqlId.And("ta.RELATEDUSERID", r.RELATEDUSERID)
|
|
|
return sqlId.String()
|
|
|
}
|
|
|
@@ -1510,3 +1514,36 @@ func (r *Qhjgoodsex) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
|
return sData, err
|
|
|
}
|
|
|
+
|
|
|
+// QhjParentAreaList 所属机构列表
|
|
|
+type QhjParentAreaList struct {
|
|
|
+ USERID int64 `json:"userid" xorm:"USERID"` // 用户ID
|
|
|
+ USERTYPE int32 `json:"usertype" xorm:"USERTYPE"` // 账户类型 - 1:交易所 2:机构 3:会员子机构 4:经纪人 5:投资者 6:客户 7:企业成员(云平台)
|
|
|
+ ACCOUNTNAME string `json:"accountname" xorm:"ACCOUNTNAME"` // 账户名称(机构名称)
|
|
|
+}
|
|
|
+
|
|
|
+func (r *QhjParentAreaList) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *QhjParentAreaList) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = "select t.userid, t.accountname, t.usertype" +
|
|
|
+ " from useraccount t" +
|
|
|
+ " where 1 = 1" +
|
|
|
+ " and t.accountstatus = 4" +
|
|
|
+ " and t.usertype = 2" +
|
|
|
+ " and t.rootuserid = %v" +
|
|
|
+ " or t.userid = %v"
|
|
|
+ sqlId.FormatParam(r.USERID, r.USERID)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+// GetDataEx 获取所属机构列表
|
|
|
+func (r *QhjParentAreaList) GetDataEx() (interface{}, error) {
|
|
|
+ sData := make([]QhjParentAreaList, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ }
|
|
|
+ return sData, err
|
|
|
+}
|