Ver Fonte

feat:xiugai

wangchuanjin há 1 ano atrás
pai
commit
4a89a2f7d9
2 ficheiros alterados com 12 adições e 12 exclusões
  1. 3 5
      api/internal/service/network.go
  2. 9 7
      api/internal/service/network_test.go

+ 3 - 5
api/internal/service/network.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"database/sql"
 	"fmt"
+	"log"
 	"math"
 	"sort"
 	"strings"
@@ -441,11 +442,7 @@ func (n *network) AllProject(in *types.AllprojectReq) (reply *types.Reply) {
 					pType += ","
 				}
 				pType += vv.Type
-			}
-			if myChildIds == "" {
 				myChildIds = tempId
-			}
-			if myChildTypes == "" {
 				myChildTypes = vv.Type
 			}
 			cm := map[string]interface{}{
@@ -534,6 +531,7 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 	}
 	if isTjProject {
 		entMonitor := NetworkCom.EntMonitor(in.UserId)
+		log.Println(entMonitor)
 		aio := n.AllIntroduceOwner(sqlAppend1, sqlAppend2, args, isTjProject, probusfors, entMonitor)
 		for _, v := range aio.Networks {
 			itype := ""
@@ -673,7 +671,7 @@ func (n *network) List(in *types.NetWorkListReq) *types.Reply {
 				"person":        v.Person,
 				"phone":         v.Phone,
 				"buyer_count":   buyer_count,
-				"monitor_count": 0,
+				"monitor_count": monitor_count,
 				"expect_amount": RetainDecimal(expect_amount/10000, 2),
 				"project_count": project_count,
 				"create_time":   v.Create_time,

+ 9 - 7
api/internal/service/network_test.go

@@ -106,10 +106,11 @@ func TestNetWorkList(t *testing.T) {
 	initDb()
 	//类型;firstparty:甲方 supplier:供应商 adiffb:同甲异业 middleman:中间人 agency:招标代理机构
 	res := Network.List(&types.NetWorkListReq{
-		//PositionId:   1205591997,
-		PositionId:   935,
+		UserId:     "1205591997",
+		PositionId: 1205591997,
+		//PositionId:   935,
 		Current_page: 1,
-		Page_size:    10,
+		Page_size:    100,
 		//PositionId: 935,
 		//PositionId: 1205591998,
 		//Order_amount: -1,
@@ -119,7 +120,7 @@ func TestNetWorkList(t *testing.T) {
 		//Project_matchme: 1,
 		//Starttime: "2024-04-23",
 		//Endtime:   "2024-04-23",
-		Type: "middleman",
+		//Type: "firstparty",
 		//Name: "三亚市",
 	})
 	for k, v := range res.Data.(map[string]interface{}) {
@@ -137,9 +138,10 @@ func TestAllProject(t *testing.T) {
 	res := Network.AllProject(&types.AllprojectReq{
 		EntAccountId: 64,
 		//PositionId:   935,
-		PositionId: 1205591997,
-		//Id:         "wcj_11111111a",
-		//Type: "firstparty",
+		PositionId: 1205591997, //刘苗
+		//PositionId: 1205592003,//刘亚丽
+		//Id:         "b57d8f87b1d748dab5b200a6f1da0d37",
+		//Type:       "firstparty",
 	})
 	b, _ := json.Marshal(res.Data)
 	log.Println(string(b))