wangchuanjin 1 سال پیش
والد
کامیت
e4bd582cc7
1فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      src/jfw/modules/subscribepay/src/service/network.go

+ 10 - 3
src/jfw/modules/subscribepay/src/service/network.go

@@ -91,20 +91,27 @@ func (n *Network) ProjectExport() {
 
 func (n *Network) search(wh []string, args []interface{}) []string {
 	bIds := []string{}
-	rows, err := util.ClickhouseConn.Query(context.Background(), `select info_ids from information.transaction_info where project_id in (`+strings.Join(wh, ",")+`)`, args...)
+	rows, err := util.ClickhouseConn.Query(context.Background(), `select info_id,info_ids from information.transaction_info where project_id in (`+strings.Join(wh, ",")+`)`, args...)
 	if err != nil {
 		log.Println(err)
 		return bIds
 	}
 	for rows.Next() {
 		var (
+			info_id  string
 			info_ids []string
 		)
-		if err := rows.Scan(&info_ids); err != nil {
+		if err := rows.Scan(&info_id, &info_ids); err != nil {
 			log.Println(err)
 			continue
 		}
-		bIds = append(bIds, info_ids...)
+		if info_ids == nil || len(info_ids) == 0 {
+			if info_id != "" {
+				bIds = append(bIds, info_id)
+			}
+		} else {
+			bIds = append(bIds, info_ids...)
+		}
 	}
 	rows.Close()
 	if err := rows.Err(); err != nil {