|
@@ -6,8 +6,8 @@ import (
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "jy/src/jfw/jyutil"
|
|
"strings"
|
|
"strings"
|
|
-
|
|
|
|
//_ "github.com/gogf/gf/contrib/drivers/clickhouse/v2"
|
|
//_ "github.com/gogf/gf/contrib/drivers/clickhouse/v2"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
@@ -170,19 +170,10 @@ func DistrictsTender(number int) []argument {
|
|
}
|
|
}
|
|
|
|
|
|
var (
|
|
var (
|
|
- data []argument
|
|
|
|
- upperLimit int
|
|
|
|
|
|
+ data []argument
|
|
)
|
|
)
|
|
- areaMap := make(map[string]int)
|
|
|
|
- for _, acronym := range KeyBiddingAreaMap {
|
|
|
|
- if areaMap[acronym.area] > 2 {
|
|
|
|
- continue
|
|
|
|
- }
|
|
|
|
- areaMap[acronym.area]++
|
|
|
|
- upperLimit++
|
|
|
|
- if upperLimit > number {
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
|
|
+ for _, i2 := range jyutil.GenerateRandomNumber(0, len(KeyBiddingAreaMap), number) {
|
|
|
|
+ acronym := KeyBiddingAreaMap[i2]
|
|
data = append(data, argument{
|
|
data = append(data, argument{
|
|
common.If(strings.Contains(acronym.district, "区"), fmt.Sprintf("%s%s", acronym.city, acronym.district), acronym.district).(string),
|
|
common.If(strings.Contains(acronym.district, "区"), fmt.Sprintf("%s%s", acronym.city, acronym.district), acronym.district).(string),
|
|
fmt.Sprintf("/list/area/%s.html", acronym.code),
|
|
fmt.Sprintf("/list/area/%s.html", acronym.code),
|