소스 검색

修改数据类型

wangchuanjin 2 년 전
부모
커밋
8c66a7fb5e

+ 2 - 2
jyBXSubscribe/rpc/bxsubscribe.proto

@@ -51,8 +51,8 @@ message subscribeInfo {
   int64 ca_isvisit = 10;
   int64  ca_type = 11;
   repeated string  matchKeys = 12;
-  string budget = 13;
-  string bidAmount = 14;
+  double budget = 13;
+  double bidAmount = 14;
   int64 collection = 15;
   string  buyer = 16;
   string  projectName = 17;

+ 4 - 6
jyBXSubscribe/rpc/model/push.go

@@ -203,8 +203,6 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *bxs
 	if _id == "" {
 		_id = common.ObjToString((*info)["_id"])
 	}
-	log.Println(info)
-	log.Println()
 	return &bxsubscribe.SubscribeInfo{
 		XId:          encrypt.EncodeArticleId2ByCheck(_id),
 		Title:        common.InterfaceToStr((*info)["title"]),
@@ -219,8 +217,8 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}) *bxs
 		CaIsvip:      int64(p.Isvip),
 		CaType:       int64(p.Type),
 		MatchKeys:    p.Keys,
-		Budget:       common.InterfaceToStr((*info)["budget"]),
-		BidAmount:    common.InterfaceToStr((*info)["bidamount"]),
+		Budget:       common.Float64All((*info)["budget"]),
+		BidAmount:    common.Float64All((*info)["bidamount"]),
 		Buyer:        common.InterfaceToStr((*info)["buyer"]),
 		ProjectName:  common.InterfaceToStr((*info)["projectname"]),
 		Winner:       common.InterfaceToStr((*info)["s_winner"]),
@@ -359,7 +357,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 	querys = append(querys, " 1=1 ")
 	start2 := int64(0)
 	if spqp.SelectInfoIds != nil && len(spqp.SelectInfoIds) > 0 {
-		searchSql = fmt.Sprintf(" from %s a LEFT JOIN %s b ON a.infoid = b.infoid where %s order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
+		searchSql = fmt.Sprintf(" from %s a LEFT JOIN %s b ON a.infoid = b.infoid where %s order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
 		logx.Info("searchSql", searchSql)
 		//查询总数
 		count = spqp.BaseServiceMysql.CountBySql(fmt.Sprintf("select count(a.id)" + searchSql))
@@ -534,7 +532,7 @@ func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, en
 			}
 		}
 		searchSql = fmt.Sprintf(" from %s  a STRAIGHT_JOIN %s b ON %s and a.infoid = b.infoid  %s where %s"+
-			" order by a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, userStr, leftJoinStr, strings.Join(querys, " and "))
+			" order by a.date desc,a.id desc", aboutDbMsg[s.ModuleFlag].MysqlTable, Baseinfo, userStr, leftJoinStr, strings.Join(querys, " and "))
 		logx.Info("searchSql", searchSql)
 		//查询总数
 		logx.Info(fmt.Sprintf("select   count(DISTINCT a.id) " + searchSql))

+ 10 - 10
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.28.0
-// 	protoc        v3.15.1
+// 	protoc-gen-go v1.27.1
+// 	protoc        v3.20.0--rc2
 // source: bxsubscribe.proto
 
 package bxsubscribe
@@ -362,8 +362,8 @@ type SubscribeInfo struct {
 	CaIsvisit    int64    `protobuf:"varint,10,opt,name=ca_isvisit,json=caIsvisit,proto3" json:"ca_isvisit,omitempty"`
 	CaType       int64    `protobuf:"varint,11,opt,name=ca_type,json=caType,proto3" json:"ca_type,omitempty"`
 	MatchKeys    []string `protobuf:"bytes,12,rep,name=matchKeys,proto3" json:"matchKeys,omitempty"`
-	Budget       string   `protobuf:"bytes,13,opt,name=budget,proto3" json:"budget,omitempty"`
-	BidAmount    string   `protobuf:"bytes,14,opt,name=bidAmount,proto3" json:"bidAmount,omitempty"`
+	Budget       float64  `protobuf:"fixed64,13,opt,name=budget,proto3" json:"budget,omitempty"`
+	BidAmount    float64  `protobuf:"fixed64,14,opt,name=bidAmount,proto3" json:"bidAmount,omitempty"`
 	Collection   int64    `protobuf:"varint,15,opt,name=collection,proto3" json:"collection,omitempty"`
 	Buyer        string   `protobuf:"bytes,16,opt,name=buyer,proto3" json:"buyer,omitempty"`
 	ProjectName  string   `protobuf:"bytes,17,opt,name=projectName,proto3" json:"projectName,omitempty"`
@@ -491,18 +491,18 @@ func (x *SubscribeInfo) GetMatchKeys() []string {
 	return nil
 }
 
-func (x *SubscribeInfo) GetBudget() string {
+func (x *SubscribeInfo) GetBudget() float64 {
 	if x != nil {
 		return x.Budget
 	}
-	return ""
+	return 0
 }
 
-func (x *SubscribeInfo) GetBidAmount() string {
+func (x *SubscribeInfo) GetBidAmount() float64 {
 	if x != nil {
 		return x.BidAmount
 	}
-	return ""
+	return 0
 }
 
 func (x *SubscribeInfo) GetCollection() int64 {
@@ -1796,9 +1796,9 @@ var file_bxsubscribe_proto_rawDesc = []byte{
 	0x52, 0x06, 0x63, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x74, 0x63,
 	0x68, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x74,
 	0x63, 0x68, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74,
-	0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1c,
+	0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x62, 0x75, 0x64, 0x67, 0x65, 0x74, 0x12, 0x1c,
 	0x0a, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a,
+	0x01, 0x52, 0x09, 0x62, 0x69, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a,
 	0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03,
 	0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05,
 	0x62, 0x75, 0x79, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x79,

+ 1 - 1
jyBXSubscribe/rpc/type/bxsubscribe/bxsubscribe_grpc.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 // versions:
 // - protoc-gen-go-grpc v1.2.0
-// - protoc             v3.15.1
+// - protoc             v3.20.0--rc2
 // source: bxsubscribe.proto
 
 package bxsubscribe