wangchuanjin 9 månader sedan
förälder
incheckning
d0a701b42f
2 ändrade filer med 6 tillägg och 10 borttagningar
  1. 4 8
      api/internal/service/network.go
  2. 2 2
      api/internal/service/network_test.go

+ 4 - 8
api/internal/service/network.go

@@ -573,7 +573,7 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 	if in.Current_page <= 0 {
 		in.Current_page = 1
 	}
-	dbPaging := in.Buyercount_start == 0 && in.Buyercount_end == 0 && in.Monitor == 0 && in.Monitorcount_start == 0 && in.Monitorcount_end == 0 && in.Project_matchme == 0 && in.Order_amount == 0
+	dbPaging := in.Buyercount_start == 0 && in.Buyercount_end == 0 && in.Monitor == 0 && in.Monitorcount_start == 0 && in.Monitorcount_end == 0 && in.Order_amount == 0
 	sqlAppendArgs := []interface{}{}
 	sqlAppend1 := ""
 	if dbPaging && in.Type != "" {
@@ -637,11 +637,9 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 	list := []*map[string]interface{}{}
 	isTjProject := true
 	businessType := []string{}
-	if in.Project_matchme == 1 {
-		businessType = strings.Split(FindBusiness(in.EntId, in.MgoUserId), ",")
-		if len(businessType) == 0 {
-			isTjProject = false
-		}
+	businessType = strings.Split(FindBusiness(in.EntId, in.MgoUserId), ",")
+	if len(businessType) == 0 {
+		isTjProject = false
 	}
 	entMonitor := NetworkCom.EntMonitor(in.UserId)
 	aio := n.AllIntroduceOwner(sqlAppend1, sqlAppend2, args, isTjProject, businessType, entMonitor)
@@ -737,8 +735,6 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 			continue
 		} else if in.Monitorcount_end > 0 && monitor_count > in.Monitorcount_end {
 			continue
-		} else if in.Project_matchme == 1 && project_count == 0 {
-			continue
 		}
 		if !dbPaging {
 			switch v.Itype {

+ 2 - 2
api/internal/service/network_test.go

@@ -11,7 +11,7 @@ import (
 	"bp.jydev.jianyu360.cn/CRM/networkManage/api/internal/types"
 )
 
-//go test -test.run=TestAddCustomService -fs=../../etc/crmapplication.yaml -lf=../../etc/logs.yaml -df=../../etc/db.yaml -pf=../../etc/push.yaml
+//go test -test.run=TestNetWorkList -fs=../../etc/networkmanage.yaml -lf=../../etc/logs.yaml -df=../../etc/db.yaml
 
 func TestAddOrUpdate(t *testing.T) {
 	InitConf()
@@ -90,7 +90,7 @@ func TestNetWorkList(t *testing.T) {
 		// Monitorcount_start: 1,
 		// Monitorcount_end:   1,
 		//Monitor: 1,
-		//Project_matchme: 1,
+		Project_matchme: 1,
 		//Starttime: "2024-04-23",
 		//Endtime:   "2024-04-23",
 		//Type: "middleman",