Pārlūkot izejas kodu

资金账户查询相关接口增加资金状态过滤(TRADESTATUS = 1)

zhou.xiaoning 4 gadi atpakaļ
vecāks
revīzija
dd1990eb20
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      models/account.go

+ 4 - 4
models/account.go

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