This commit is contained in:
JNG 2026-01-12 14:36:20 +08:00
parent 185e5da57a
commit bbe0c0390c
6 changed files with 52 additions and 4 deletions

View File

@ -518,6 +518,7 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
Amount: record.Amount, Amount: record.Amount,
CustomerId: customerID, CustomerId: customerID,
PayTime: record.PayTime, PayTime: record.PayTime,
InviterId: record.InviterID,
} }
// 聚合子订单 // 聚合子订单

View File

@ -69,6 +69,7 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
Language: req.Language, Language: req.Language,
BundleOrderValueAdd: addRecords, BundleOrderValueAdd: addRecords,
PlatformIds: req.PlatformIds, PlatformIds: req.PlatformIds,
InviterID: req.InviterId,
} }
res, err = dao.CreateOrderRecord(orderRecord) res, err = dao.CreateOrderRecord(orderRecord)
return return

View File

@ -45,6 +45,7 @@ type BundleOrderRecords struct {
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"` BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"` ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
PlatformIds PlatformIDs `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3 , DM = 4, BL = 5;" json:"platformIDs"` PlatformIds PlatformIDs `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3 , DM = 4, BL = 5;" json:"platformIDs"`
InviterID uint64 `gorm:"column:inviter_id;type:bigint;comment:邀请人ID" json:"inviterID"`
} }
type BundleOrderValueAdd struct { type BundleOrderValueAdd struct {
gorm.Model gorm.Model

View File

@ -218,6 +218,7 @@ message OrderCreateRecord{
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; // repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //
string orderNo = 21 [json_name = "orderNo"]; string orderNo = 21 [json_name = "orderNo"];
repeated uint32 platformIds = 22; // ID集合 (json ) repeated uint32 platformIds = 22; // ID集合 (json )
uint64 inviterId = 23; // ID
} }
message OrderCreateAddRecord{ message OrderCreateAddRecord{
int32 serviceType = 1 [json_name = "serviceType"]; int32 serviceType = 1 [json_name = "serviceType"];
@ -270,6 +271,9 @@ message OrderBundleRecordInfo{
int64 customerId = 9; int64 customerId = 9;
string payTime = 10; string payTime = 10;
string subNum = 11; string subNum = 11;
uint64 inviterId = 12;
string inviterCode = 13;
string inviterName = 14;
} }
message OrderAddBundleRecordInfo{ message OrderAddBundleRecordInfo{
string orderAddNo = 1; string orderAddNo = 1;

View File

@ -863,6 +863,7 @@ type OrderCreateRecord struct {
AddRecords []*OrderCreateAddRecord `protobuf:"bytes,20,rep,name=addRecords,proto3" json:"addRecords"` //增值服务 AddRecords []*OrderCreateAddRecord `protobuf:"bytes,20,rep,name=addRecords,proto3" json:"addRecords"` //增值服务
OrderNo string `protobuf:"bytes,21,opt,name=orderNo,proto3" json:"orderNo"` OrderNo string `protobuf:"bytes,21,opt,name=orderNo,proto3" json:"orderNo"`
PlatformIds []uint32 `protobuf:"varint,22,rep,packed,name=platformIds,proto3" json:"platformIds"` // 发布平台ID集合 (json 格式字符串) PlatformIds []uint32 `protobuf:"varint,22,rep,packed,name=platformIds,proto3" json:"platformIds"` // 发布平台ID集合 (json 格式字符串)
InviterId uint64 `protobuf:"varint,23,opt,name=inviterId,proto3" json:"inviterId"` // 邀请人ID
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@ -1051,6 +1052,13 @@ func (x *OrderCreateRecord) GetPlatformIds() []uint32 {
return nil return nil
} }
func (x *OrderCreateRecord) GetInviterId() uint64 {
if x != nil {
return x.InviterId
}
return 0
}
type OrderCreateAddRecord struct { type OrderCreateAddRecord struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
ServiceType int32 `protobuf:"varint,1,opt,name=serviceType,proto3" json:"serviceType"` ServiceType int32 `protobuf:"varint,1,opt,name=serviceType,proto3" json:"serviceType"`
@ -1436,6 +1444,9 @@ type OrderBundleRecordInfo struct {
CustomerId int64 `protobuf:"varint,9,opt,name=customerId,proto3" json:"customerId"` CustomerId int64 `protobuf:"varint,9,opt,name=customerId,proto3" json:"customerId"`
PayTime string `protobuf:"bytes,10,opt,name=payTime,proto3" json:"payTime"` PayTime string `protobuf:"bytes,10,opt,name=payTime,proto3" json:"payTime"`
SubNum string `protobuf:"bytes,11,opt,name=subNum,proto3" json:"subNum"` SubNum string `protobuf:"bytes,11,opt,name=subNum,proto3" json:"subNum"`
InviterId uint64 `protobuf:"varint,12,opt,name=inviterId,proto3" json:"inviterId"`
InviterCode string `protobuf:"bytes,13,opt,name=inviterCode,proto3" json:"inviterCode"`
InviterName string `protobuf:"bytes,14,opt,name=inviterName,proto3" json:"inviterName"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@ -1547,6 +1558,27 @@ func (x *OrderBundleRecordInfo) GetSubNum() string {
return "" return ""
} }
func (x *OrderBundleRecordInfo) GetInviterId() uint64 {
if x != nil {
return x.InviterId
}
return 0
}
func (x *OrderBundleRecordInfo) GetInviterCode() string {
if x != nil {
return x.InviterCode
}
return ""
}
func (x *OrderBundleRecordInfo) GetInviterName() string {
if x != nil {
return x.InviterName
}
return ""
}
type OrderAddBundleRecordInfo struct { type OrderAddBundleRecordInfo struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
OrderAddNo string `protobuf:"bytes,1,opt,name=orderAddNo,proto3" json:"orderAddNo"` OrderAddNo string `protobuf:"bytes,1,opt,name=orderAddNo,proto3" json:"orderAddNo"`
@ -14969,7 +15001,7 @@ const file_pb_bundle_proto_rawDesc = "" +
"\bduration\x18\b \x01(\x05R\bduration\x12\x12\n" + "\bduration\x18\b \x01(\x05R\bduration\x12\x12\n" +
"\x04unit\x18\t \x01(\tR\x04unit\x12\x1a\n" + "\x04unit\x18\t \x01(\tR\x04unit\x12\x1a\n" +
"\buserName\x18\n" + "\buserName\x18\n" +
" \x01(\tR\buserName\"\xe5\x05\n" + " \x01(\tR\buserName\"\x83\x06\n" +
"\x11OrderCreateRecord\x12\x1e\n" + "\x11OrderCreateRecord\x12\x1e\n" +
"\n" + "\n" +
"bundleUuid\x18\x01 \x01(\tR\n" + "bundleUuid\x18\x01 \x01(\tR\n" +
@ -15007,7 +15039,8 @@ const file_pb_bundle_proto_rawDesc = "" +
"addRecords\x18\x14 \x03(\v2\x1c.bundle.OrderCreateAddRecordR\n" + "addRecords\x18\x14 \x03(\v2\x1c.bundle.OrderCreateAddRecordR\n" +
"addRecords\x12\x18\n" + "addRecords\x12\x18\n" +
"\aorderNo\x18\x15 \x01(\tR\aorderNo\x12 \n" + "\aorderNo\x18\x15 \x01(\tR\aorderNo\x12 \n" +
"\vplatformIds\x18\x16 \x03(\rR\vplatformIds\"\x92\x03\n" + "\vplatformIds\x18\x16 \x03(\rR\vplatformIds\x12\x1c\n" +
"\tinviterId\x18\x17 \x01(\x04R\tinviterId\"\x92\x03\n" +
"\x14OrderCreateAddRecord\x12 \n" + "\x14OrderCreateAddRecord\x12 \n" +
"\vserviceType\x18\x01 \x01(\x05R\vserviceType\x12\x1a\n" + "\vserviceType\x18\x01 \x01(\x05R\vserviceType\x12\x1a\n" +
"\bvalueUid\x18\x02 \x01(\tR\bvalueUid\x12\"\n" + "\bvalueUid\x18\x02 \x01(\tR\bvalueUid\x12\"\n" +
@ -15055,7 +15088,7 @@ const file_pb_bundle_proto_rawDesc = "" +
"bundleInfo\x12\x12\n" + "bundleInfo\x12\x12\n" +
"\x04page\x18\x02 \x01(\x05R\x04page\x12\x1a\n" + "\x04page\x18\x02 \x01(\x05R\x04page\x12\x1a\n" +
"\bpageSize\x18\x03 \x01(\x05R\bpageSize\x12\x14\n" + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\x12\x14\n" +
"\x05total\x18\x04 \x01(\x05R\x05total\"\x85\x03\n" + "\x05total\x18\x04 \x01(\x05R\x05total\"\xe7\x03\n" +
"\x15OrderBundleRecordInfo\x12\x18\n" + "\x15OrderBundleRecordInfo\x12\x18\n" +
"\aorderNo\x18\x01 \x01(\tR\aorderNo\x12\x1e\n" + "\aorderNo\x18\x01 \x01(\tR\aorderNo\x12\x1e\n" +
"\n" + "\n" +
@ -15072,7 +15105,10 @@ const file_pb_bundle_proto_rawDesc = "" +
"customerId\x12\x18\n" + "customerId\x12\x18\n" +
"\apayTime\x18\n" + "\apayTime\x18\n" +
" \x01(\tR\apayTime\x12\x16\n" + " \x01(\tR\apayTime\x12\x16\n" +
"\x06subNum\x18\v \x01(\tR\x06subNum\"\xda\x03\n" + "\x06subNum\x18\v \x01(\tR\x06subNum\x12\x1c\n" +
"\tinviterId\x18\f \x01(\x04R\tinviterId\x12 \n" +
"\vinviterCode\x18\r \x01(\tR\vinviterCode\x12 \n" +
"\vinviterName\x18\x0e \x01(\tR\vinviterName\"\xda\x03\n" +
"\x18OrderAddBundleRecordInfo\x12\x1e\n" + "\x18OrderAddBundleRecordInfo\x12\x1e\n" +
"\n" + "\n" +
"orderAddNo\x18\x01 \x01(\tR\n" + "orderAddNo\x18\x01 \x01(\tR\n" +

View File

@ -68,6 +68,11 @@ func loadMysqlConn(conn string) *gorm.DB {
fmt.Println(err) fmt.Println(err)
} }
} }
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "inviter_id") == false {
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "inviter_id"); err != nil {
fmt.Println(err)
}
}
if err != nil { if err != nil {
// return nil // return nil
panic(err) panic(err)