|
@@ -5,6 +5,7 @@ import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/container/gvar"
|
|
|
+ "github.com/gogf/gf/v2/database/gdb"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
"github.com/gogf/gf/v2/util/gconv"
|
|
|
"jyseo/internal/consts"
|
|
@@ -217,14 +218,19 @@ func (query *SeoBiddingQuery) GetOnceData(ctx context.Context, total int, flag s
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func FillingBiddingBaseFields(ctx context.Context, res []map[string]interface{}) []map[string]interface{} {
|
|
|
+func FillingBiddingBaseFields(ctx context.Context, res []map[string]interface{}, filterNj ...bool) []map[string]interface{} {
|
|
|
bidIdStrings := make([]string, 0, len(res))
|
|
|
for _, m := range res {
|
|
|
if bidId := gconv.String(m["bid_id"]); bidId != "" {
|
|
|
bidIdStrings = append(bidIdStrings, bidId)
|
|
|
}
|
|
|
}
|
|
|
- bidRes, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM new_bidList WHERE bid_id IN ('%s')`, strings.Join(bidIdStrings, "','")))
|
|
|
+ var bidRes gdb.Result
|
|
|
+ if len(filterNj) > 0 { //没有过滤拟建项目和采购意向,需要查询过滤
|
|
|
+ bidRes, _ = g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM new_bidList WHERE toptype !='拟建' AND toptype !='采购意向' AND bid_id IN ('%s')`, strings.Join(bidIdStrings, "','")))
|
|
|
+ } else { //已经过滤了拟建项目和采购意向
|
|
|
+ bidRes, _ = g.DB().Query(ctx, fmt.Sprintf(`SELECT * FROM new_bidList WHERE bid_id IN ('%s')`, strings.Join(bidIdStrings, "','")))
|
|
|
+ }
|
|
|
if bidRes.IsEmpty() {
|
|
|
return nil
|
|
|
}
|