浏览代码

查询资金账号时增加返回非正常状态的账号

zhou.xiaoning 4 年之前
父节点
当前提交
9d98d8394c
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      models/account.go

+ 4 - 4
models/account.go

@@ -763,7 +763,7 @@ func GetTaAccountsByType(userID, taAccountType int) ([]Taaccount, error) {
 
 	taAccounts := make([]Taaccount, 0)
 
-	session := engine.Where("TRADESTATUS = 1 and RELATEDUSERID = ?", userID)
+	session := engine.Where("TRADESTATUS <> 7 and RELATEDUSERID = ?", userID)
 	if taAccountType != 0 {
 		session = session.And("TAACCOUNTTYPE = ?", taAccountType)
 	}
@@ -798,7 +798,7 @@ func GetTaAccountsByLoginID(loginID, taAccountType int) ([]Taaccount, error) {
 			}
 		}
 		// 获取资金账号列表
-		session := engine.Where(fmt.Sprintf("TRADESTATUS = 1 and ACCOUNTID in (%s)", accountIDs))
+		session := engine.Where(fmt.Sprintf("TRADESTATUS <> 7 and ACCOUNTID in (%s)", accountIDs))
 		if taAccountType != 0 {
 			session = session.And("TAACCOUNTTYPE = ?", taAccountType)
 		}
@@ -821,7 +821,7 @@ func GetTaAccountsByLoginID(loginID, taAccountType int) ([]Taaccount, error) {
 
 		// 直接从TaAccount表中获取
 		session := engine.Table("TAACCOUNT").
-			Join("INNER", "LOGINACCOUNT L", "L.USERID = TAACCOUNT.RELATEDUSERID and TAACCOUNT.TRADESTATUS = 1").
+			Join("INNER", "LOGINACCOUNT L", "L.USERID = TAACCOUNT.RELATEDUSERID and TAACCOUNT.TRADESTATUS <> 7").
 			Where("L.LOGINID = ?", loginID)
 		if taAccountType != 0 {
 			session = session.And("TAACCOUNT.TAACCOUNTTYPE = ?", taAccountType)
@@ -839,7 +839,7 @@ func GetTaAccountByID(accountID int) (*Taaccount, error) {
 	engine := db.GetEngine()
 
 	var taaccount Taaccount
-	has, err := engine.Where("TRADESTATUS = 1 and ACCOUNTID = ?", accountID).Get(&taaccount)
+	has, err := engine.Where("TRADESTATUS <> 7 and ACCOUNTID = ?", accountID).Get(&taaccount)
 	if err != nil {
 		return nil, err
 	}