zhouxnsz 9 månader sedan
förälder
incheckning
e97089cb19
2 ändrade filer med 56 tillägg och 56 borttagningar
  1. 1 1
      models/bank.go
  2. 55 55
      models/qhj.go

+ 1 - 1
models/bank.go

@@ -158,7 +158,7 @@ func GetAmtInByPaid(accountId int, exchticket string, channelMode string) (rsp *
 	// 尝试混合支付
 	if channelMode == "hybrid" || channelMode == "" {
 		var rec Hybridamtrec
-		has, err = engine.Where("TRADE_ACCT = ? and exch_seq = ? and deal_status = 2", accountId, exchticket).Get(&rec)
+		has, err = engine.Where("TRADE_ACCT = ? and exch_seq = ? and deal_status = 2 and out_in_flag = 1", accountId, exchticket).Get(&rec)
 		if err != nil {
 			return
 		}

+ 55 - 55
models/qhj.go

@@ -1702,61 +1702,61 @@ func (r *QhjAccountOutInApply) calc() {
 }
 
 func (r *QhjAccountOutInApply) buildSql() string {
-	var sqlId utils.SQLVal = "with tmp as(select t.userid, wm_concat(t.logincode) logincode from loginaccount t group by t.userid)" +
-		"SELECT t.EXECUTETYPE," +
-		"       t.AMOUNT," +
-		"       t.CURRENCY," +
-		"       t.CHARGE," +
-		"       t.ACCOUNTPWD," +
-		"       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME," +
-		"       t.BANKID," +
-		"       t.BRANCHBANKID," +
-		"       t.BRANCHBANKNAME," +
-		"       t.BANKACCOUNTNO," +
-		"       t.BANKACCOUNTNAME," +
-		"       t.EXTENDINFO," +
-		"       t.AUDITID," +
-		"       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME," +
-		"       t.REMARK," +
-		"       t.NETADDR," +
-		"       t.ACCOUNTTICKET," +
-		"       t.CHECKERRORFLAG," +
-		"       t.REMARK2," +
-		"       t.REAUDITID," +
-		"       to_char(t.REAUDITTIME, 'yyyy-mm-dd hh24:mi:ss') REAUDITTIME," +
-		"       t.REAUDITREMARK," +
-		"       t.APPLYREMARK," +
-		"       t.RELATEDORDERID," +
-		"       t.CAPAMOUNTOUT," +
-		"       t.INFAMOUNT," +
-		"       t.PRIAMOUNT," +
-		"       t.BANK_APPLY_TICKET," +
-		"       to_char(t.CERTIFICATEPHOTOURL) CERTIFICATEPHOTOURL," +
-		"       t.SOUCREAMOUNT," +
-		"       t.SOUCRECURRENCYID," +
-		"       t.ACCOUNTCODE," +
-		"       t.CUSBANKID," +
-		"       t.TRADEDATE," +
-		"       t.EXCHTICKET," +
-		"       t.EXTOPERATEID," +
-		"       t.BANKTICKET," +
-		"       t.APPLYSTATUS," +
-		"       u.userid," +
-		"       u.accountname," +
-		"       ui.userinfotype," +
-		"       ui.mobile," +
-		"       tmp.logincode," +
-		"       bb.bankname," +
-		"       bc.CUSBANKNAME," +
-		"       bc.CUSBANKSHORTNAME" +
-		"  FROM BANK_ACCOUNTOUTINAPPLY t" +
-		"  INNER JOIN TAACCOUNT ta on t.accountcode=to_char(ta.accountid)" +
-		"  INNER JOIN USERACCOUNT u on ta.relateduserid=u.userid" +
-		"  INNER JOIN USERINFO ui on u.userid=ui.userid" +
-		"  INNER JOIN BANK_CUSBANKINFO bc on bc.cusbankid=t.CUSBANKID" +
-		"  LEFT JOIN tmp on u.userid=tmp.userid" +
-		"  LEFT JOIN bank_bankinfo bb ON bb.bankid=t.bankid" +
-		" WHERE 1 = 1"
+	var sqlId utils.SQLVal = `with tmp as(select t.userid, wm_concat(t.logincode) logincode from loginaccount t group by t.userid)
+		SELECT t.EXECUTETYPE,
+		       t.AMOUNT,
+		       t.CURRENCY,
+		       t.CHARGE,
+		       t.ACCOUNTPWD,
+		       to_char(t.UPDATETIME, 'yyyy-mm-dd hh24:mi:ss') UPDATETIME,
+		       t.BANKID,
+		       t.BRANCHBANKID,
+		       t.BRANCHBANKNAME,
+		       t.BANKACCOUNTNO,
+		       t.BANKACCOUNTNAME,
+		       t.EXTENDINFO,
+		       t.AUDITID,
+		       to_char(t.AUDITTIME, 'yyyy-mm-dd hh24:mi:ss') AUDITTIME,
+		       t.REMARK,
+		       t.NETADDR,
+		       t.ACCOUNTTICKET,
+		       t.CHECKERRORFLAG,
+		       t.REMARK2,
+		       t.REAUDITID,
+		       to_char(t.REAUDITTIME, 'yyyy-mm-dd hh24:mi:ss') REAUDITTIME,
+		       t.REAUDITREMARK,
+		       t.APPLYREMARK,
+		       t.RELATEDORDERID,
+		       t.CAPAMOUNTOUT,
+		       t.INFAMOUNT,
+		       t.PRIAMOUNT,
+		       t.BANK_APPLY_TICKET,
+		       to_char(t.CERTIFICATEPHOTOURL) CERTIFICATEPHOTOURL,
+		       t.SOUCREAMOUNT,
+		       t.SOUCRECURRENCYID,
+		       t.ACCOUNTCODE,
+		       t.CUSBANKID,
+		       t.TRADEDATE,
+		       t.EXCHTICKET,
+		       t.EXTOPERATEID,
+		       t.BANKTICKET,
+		       t.APPLYSTATUS,
+		       u.userid,
+		       u.accountname,
+		       ui.userinfotype,
+		       ui.mobile,
+		       tmp.logincode,
+		       bb.bankname,
+		       bc.CUSBANKNAME,
+		       bc.CUSBANKSHORTNAME
+		  FROM BANK_ACCOUNTOUTINAPPLY t
+		  INNER JOIN TAACCOUNT ta on t.accountcode=to_char(ta.accountid)
+		  INNER JOIN USERACCOUNT u on ta.relateduserid=u.userid
+		  INNER JOIN USERINFO ui on u.userid=ui.userid
+		  INNER JOIN BANK_CUSBANKINFO bc on bc.cusbankid=t.CUSBANKID
+		  LEFT JOIN tmp on u.userid=tmp.userid
+		  LEFT JOIN bank_bankinfo bb ON bb.bankid=t.bankid 
+		 WHERE 1 = 1`
 	sqlId.And("u.userid", r.USERID)
 	sqlId.AndEx("t.EXECUTETYPE", r.QUERYTYPE, r.QUERYTYPE > 0)
 	switch r.STATUS {