package task import ( "applet/app/task/svc" "applet/app/utils" "fmt" "math/rand" "time" ) func taskPayLifeOrderSettle() { for { if len(ch) > workerNum { time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) } else { goto START } } START: ch <- 1 month := utils.GetTimeRange("current_month") fmt.Println(month) arg := map[string]string{ "status": "订单付款", "sort": "id desc", "is_to_settle": "2", "is_commission": "1", "to_settle_time": utils.Int64ToStr(month["start"]), "p": "1", "size": "100", "pvd": "own_didi_online_car,own_didi_freight,own_didi_chauffeur,own_oilstation,own_king_flower", } svc.LifeOrderSettle(arg) <-ch }