瀏覽代碼

fix:回款逻辑调整

duxin 1 周之前
父節點
當前提交
c78b6afe93
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      internal/logic/timedTask/automaticPayment.go

+ 4 - 0
internal/logic/timedTask/automaticPayment.go

@@ -161,6 +161,10 @@ WHERE
 								}
 								updateData["return_status"] = 2
 								//isFirstReturn := config.JysqlDB.Count("return_money_record", map[string]interface{}{"state": 1, "order_code": orderCode}) == 0
+								count, _ := g.DB().GetCount(ctx, fmt.Sprintf("SELECT count(*) FROM return_money_record where order_code='%s' and bank_flow='%s'", orderCode, BNKFLW))
+								if count > 0 {
+									continue
+								}
 								returnReq, _ := g.DB().Insert(ctx, "return_money_record", map[string]interface{}{
 									"order_code":            orderCode,
 									"return_time":           returnTime,