Compare commits

...

33 Commits

Author SHA1 Message Date
jiaji.H
c3f713faa7 Update:更新统计逻辑 2026-06-12 14:10:00 +08:00
jiaji.H
0d41e1a0c5 Update:更像先用后付合同pdf 2026-06-11 16:20:07 +08:00
jiaji.H
72427f8268 fix 2026-06-11 13:27:02 +08:00
jiaji.H
24b6506be8 fix 2026-06-11 13:19:07 +08:00
jiaji.H
669e5377bb Update:更新余量字段获取 2026-06-11 13:11:54 +08:00
jiaji.H
48e0bdd93d Update:更新创建余量逻辑 2026-06-11 11:50:38 +08:00
jiaji.H
7a870a641b Update:修复字段 2026-06-11 11:27:12 +08:00
jiaji.H
cd4c003bcd Update:更新检索 2026-06-11 11:20:38 +08:00
jiaji.H
8e52bba692 Update:增加月份筛选 2026-06-11 11:01:11 +08:00
jiaji.H
8efae21524 Update:增加先用后付余量出 2026-06-11 10:27:32 +08:00
jiaji.H
4b7c56d1b6 Update:增加过滤 2026-06-11 09:48:43 +08:00
jiaji.H
ae3d62ff24 Update:使用记录增加套餐类型过滤 2026-06-10 17:46:45 +08:00
jiaji.H
bb30a04163 Update:更新查询逻辑 2026-06-10 17:20:14 +08:00
jiaji.H
45385724d1 Update:更新查询逻辑 2026-06-10 17:17:00 +08:00
jiaji.H
3ea4a9f1d8 Update:增加先用后付余量列表接口 2026-06-10 16:22:36 +08:00
jiaji.H
4f3d256091 Update:更新支持不同类型的套餐不同的配置 2026-06-10 15:25:51 +08:00
jiaji.H
a10e13c642 Update:更新pb文件 2026-06-10 13:45:30 +08:00
jiaji.H
debafff038 Update:增加先用后付合同 2026-06-10 13:22:07 +08:00
jiaji.H
f6127e87a3 Update:更新pb文件 2026-06-10 10:54:40 +08:00
jiaji.H
132232d183 Update:更新pb文件 2026-06-09 11:04:33 +08:00
jiaji.H
375998a746 Update:更新余量列表获取 2026-06-09 10:39:23 +08:00
jiaji.H
6a313329e8 Update:增加订单过滤插叙 2026-06-08 19:25:54 +08:00
jiaji.H
46cea10a5e Update:增加查询指定用户未过期的订单列表 2026-06-08 19:17:52 +08:00
jiaji.H
307905849b Update 2026-06-08 14:04:31 +08:00
jiaji.H
17c8114b47 Update:增加字段 2026-06-08 11:51:31 +08:00
jiaji.H
f9c7edf7c3 Update:增加字段赋值 2026-06-05 13:36:32 +08:00
jiaji.H
20f94743d4 Merge branch 'feat-hjj-Paylater' of http://gitea.tools.fontree.cn:3000/fiee/micro-bundle into feat-hjj-Paylater 2026-06-05 11:02:00 +08:00
jiaji.H
d668424ac7 Update:增加对应类型 2026-06-05 10:58:40 +08:00
jiaji.H
f2eb757c67 Update 2026-06-04 15:40:27 +08:00
jiaji.H
acdd67e0ae Update:增加套餐类型 2026-06-04 14:26:32 +08:00
jiaji.H
2fd6a2429c Update:更新字段 2026-06-03 17:09:53 +08:00
jiaji.H
7df0804b3d Update:调整字段位置 2026-06-03 17:00:00 +08:00
jiaji.H
ffbb174857 Update:增加字段 2026-06-03 16:45:55 +08:00
15 changed files with 6843 additions and 5250 deletions

View File

@ -22,11 +22,21 @@ func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.Get
return logic.GetBundleBalanceList(req)
}
// 先用后付套餐余量信息列表
func (b *BundleProvider) GetPayLaterBundleBalanceList(_ context.Context, req *bundle.GetPayLaterBundleBalanceListReq) (*bundle.GetPayLaterBundleBalanceListResp, error) {
return logic.GetPayLaterBundleBalanceList(req)
}
// 根据用户ID查询套餐余额
func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
return logic.GetBundleBalanceByUserId(req)
}
// 根据用户ID查询套餐订单列表过期的套餐订单不展示
func (b *BundleProvider) GetBundleOrderListByUserId(_ context.Context, req *bundle.GetBundleOrderListByUserIdReq) (*bundle.GetBundleOrderListByUserIdResp, error) {
return logic.GetBundleOrderListByUserId(req)
}
func (b *BundleProvider) GetBundleBalanceByOrderUUID(_ context.Context, req *bundle.GetBundleBalanceByOrderUUIDReq) (*bundle.GetBundleBalanceByOrderUUIDResp, error) {
startTime, status, err := logic.GetBundleBalanceByOrderUUID(req.OrderUUID)
if err != nil {
@ -83,11 +93,16 @@ func (b *BundleProvider) BundleActivate(_ context.Context, req *bundle.BundleAct
return nil, logic.BundleActivate(req)
}
// 套餐余额导出
// 普通套餐余额导出
func (b *BundleProvider) BundleBalanceExport(_ context.Context, req *bundle.BundleBalanceExportReq) (*bundle.BundleBalanceExportResp, error) {
return logic.BundleBalanceExport(req)
}
// 先用后付套餐余额导出
func (b *BundleProvider) PayLaterBundleBalanceExport(_ context.Context, req *bundle.BundleBalanceExportReq) (*bundle.PayLaterBundleBalanceExportResp, error) {
return logic.PayLaterBundleBalanceExport(req)
}
func (b *BundleProvider) GetBundleBalanceLayout(_ context.Context, req *bundle.GetBundleBalanceLayoutReq) (*bundle.GetBundleBalanceLayoutResp, error) {
return logic.GetBundleBalanceLayout(req)
}

View File

@ -23,6 +23,7 @@ func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err err
return
}
// 测试注释
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? and language= ?", req.UUID, req.Language).Updates(req).Error
@ -64,6 +65,10 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
query = query.Where("language like ?", req.Language)
}
if req.BundleType != 0 {
query = query.Where("bundle_type = ?", req.BundleType)
}
count := *query
if req.PageSize != 0 && req.Page != 0 {
@ -88,6 +93,8 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
CompanySign: bundleProfile.CompanySign,
ContractDuration: int64(bundleProfile.ContractDuration),
BundleCommonUid: bundleProfile.BundleCommonUid,
BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
})
}
@ -127,6 +134,8 @@ func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
CompanySign: bundleProfile.CompanySign,
ContractDuration: int64(bundleProfile.ContractDuration),
BundleCommonUid: bundleProfile.BundleCommonUid,
BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
}
return
}
@ -150,6 +159,10 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
baseQuery = baseQuery.Where("language like ?", req.Language)
}
if req.BundleType != 0 {
baseQuery = baseQuery.Where("bundle_type = ?", req.BundleType)
}
var total int64
if err = baseQuery.Count(&total).Error; err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐总数失败: ")
@ -224,6 +237,8 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
})
}
}
@ -378,7 +393,7 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
res.Bundles = make([]*bundle.BundleProfile, 0)
bundles := make([]*model.BundleProfile, 0)
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("shelf_status = ?", 1).Preload("BundleProfileLang")
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("shelf_status = ?", model.BundleShelfStatusUp).Preload("BundleProfileLang")
//query = query.Where("shelf_status = ?", 1) //上架的
if req.Name != "" {
@ -393,6 +408,10 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
query = query.Where("language like ?", req.Language)
}
if req.BundleType != 0 {
query = query.Where("bundle_type = ?", req.BundleType)
}
count := *query
// 排序sort 升序,相同 sort 按 created_at 倒序
@ -451,6 +470,8 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
BundleType: int64(bundleProfile.BundleType),
PayLaterTime: int64(bundleProfile.PayLaterTime),
})
}
}

View File

@ -73,6 +73,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
Joins(`INNER JOIN (
SELECT customer_id, MAX(created_at) AS max_created_time
FROM bundle_order_records
WHERE order_type = 1 AND deleted_at is NULL
GROUP BY customer_id
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
@ -90,7 +91,8 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
Where("rn.name IS NOT NULL").
Where("u.deleted_at = 0").
Where("bor.deleted_at IS NULL").
Where("bor.status = 2").
Where("((bor.order_mode = 2 AND bor.pay_later_status > 0 ) OR (bor.order_mode = 1 AND bor.status = 2 ))").
Where("bb.bundle_type = ?", model.BundleTypeBasic).
Order("bor.expiration_time desc")
if req.UserName != "" {
if utils.IsPhoneNumber(req.UserName) {
@ -152,15 +154,110 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
return
}
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
// 查询先用后付套餐余量列表 (bundle_type = 2)
// 每个艺人一行:视频字段对该艺人所有未过期且 bundle_type=2 的套餐的"无限制增值视频"列求和
// (每个 order_uuid 取最新 month 的快照去重),下单时间/过期时间取最新一笔套餐
func GetPayLaterBundleBalanceList(req *bundle.GetPayLaterBundleBalanceListReq) (data []model.PayLaterBundleBalancePo, total int64, err error) {
// 1. 每个未过期 bundle_type=2 套餐取最新 month 的那条快照(去重)
latestMonthPerPkg := app.ModuleClients.BundleDB.Table("bundle_balance").
Select("user_id, order_uuid, MAX(month) AS month").
Where("bundle_type = ?", model.BundleTypePostpaid).
Where("deleted_at IS NULL").
Where("expired_at > NOW()").
Group("user_id, order_uuid")
// 2. 按用户聚合:对去重后的套餐快照求和无限制增值视频相关列
aggQuery := app.ModuleClients.BundleDB.Table("bundle_balance AS bb").
Select(`bb.user_id,
SUM(bb.increase_video_number) AS bundle_video_sum_number,
SUM(bb.increase_video_consumption_number) AS bundle_video_consumption_number,
SUM(bb.increase_video_number) - SUM(bb.increase_video_consumption_number) AS bundle_video_number,
SUM(bb.invalid_increase_video_number) AS bundle_video_invalid_number,
SUM(bb.monthly_increase_video_consumption_number) AS monthly_bundle_video_consumption_number,
SUM(bb.monthly_invalid_increase_video_number) AS monthly_bundle_video_invalid_number,
SUM(bb.increase_video_number) - SUM(bb.increase_video_consumption_number) AS monthly_bundle_video_number`).
Joins("INNER JOIN (?) AS lp ON bb.user_id = lp.user_id AND bb.order_uuid = lp.order_uuid AND bb.month = lp.month", latestMonthPerPkg).
Where("bb.deleted_at IS NULL").
Group("bb.user_id")
// 3. 最新一笔订单(用于展示套餐名/下单时间/客户编号)
latestOrder := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
Select("bor1.*").
Joins(`INNER JOIN (
SELECT customer_id, MAX(created_at) AS max_created_time
FROM bundle_order_records
WHERE status = 2 AND deleted_at is NULL
WHERE order_type = 2 AND deleted_at is NULL AND pay_later_status > 0
GROUP BY customer_id
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
Select(`u.id as user_id, rn.name as user_name, u.tel_num as user_phone_number,
bor.customer_num, bor.bundle_name, bor.uuid as order_uuid, bor.created_at as pay_time, bc.activate,
lb.expired_at,
agg.bundle_video_sum_number,
agg.bundle_video_consumption_number,
agg.bundle_video_number,
agg.bundle_video_invalid_number,
agg.monthly_bundle_video_consumption_number,
agg.monthly_bundle_video_invalid_number,
agg.monthly_bundle_video_number`).
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id and rn.deleted_at = 0").
Joins("INNER JOIN (?) AS agg ON agg.user_id = u.id", aggQuery).
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", latestOrder).
Joins(`LEFT JOIN bundle_balance lb ON lb.user_id = u.id AND lb.order_uuid = bor.uuid AND lb.deleted_at IS NULL
AND lb.month = (SELECT MAX(month) FROM bundle_balance WHERE user_id = u.id AND order_uuid = bor.uuid AND deleted_at IS NULL)`).
Joins("LEFT JOIN bundle_activate bc on bc.user_id = u.id").
Where("rn.name IS NOT NULL").
Where("u.deleted_at = 0").
Order("bor.created_at desc")
if req.UserName != "" {
if utils.IsPhoneNumber(req.UserName) {
session = session.Where("u.tel_num = ?", req.UserName)
} else {
session = session.Where("rn.name LIKE ? OR bor.customer_num LIKE ?", "%"+req.UserName+"%", "%"+req.UserName+"%")
}
}
if req.BundleName != "" {
session = session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%")
}
if req.ExpiredTimeEnd != 0 {
session = session.Where("lb.expired_at <= ?", time.UnixMilli(req.ExpiredTimeEnd))
}
if req.ExpiredTimeStart != 0 {
session = session.Where("lb.expired_at >= ?", time.UnixMilli(req.ExpiredTimeStart))
}
if req.StartTimeStart != 0 {
session = session.Where("bor.created_at >= ?", time.UnixMilli(req.StartTimeStart))
}
if req.StartTimeEnd != 0 {
session = session.Where("bor.created_at <= ?", time.UnixMilli(req.StartTimeEnd))
}
if len(req.Month) == 0 {
newestMonthQuery := app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Select("max(month) as month,user_id").Group("user_id")
session.Joins("LEFT JOIN (?) as newest_month on newest_month.user_id = lb.user_id", newestMonthQuery).Where("")
} else {
session = session.Where("lb.month in (?)", req.Month)
}
err = session.Count(&total).Error
if err != nil {
return
}
if req.Page != 0 && req.PageSize != 0 {
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
err = session.Find(&data).Error
return
}
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
Select("bor1.*").
Joins(`INNER JOIN (
SELECT customer_id
FROM bundle_order_records
WHERE ((order_mode = 2 AND pay_later_status > 0 ) OR (order_mode = 1 AND status = 2 )) AND deleted_at is NULL
GROUP BY customer_id
) bor2 ON bor1.customer_id = bor2.customer_id`)
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").Unscoped().
Select(`bb.*, bor.bundle_name, bor.status,bor.amount AS payment_amount,bor.amount_type AS payment_type,bor.customer_num,
bor.uuid as order_uuid, rn.name as user_name,bc.activate,bor.created_at as pay_time,
@ -173,11 +270,28 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data mod
Where("u.deleted_at = 0").
Where("u.id = ?", req.UserId).
Where("bb.month = ?", time.Now().Format("2006-01")).
Order("bor.expiration_time desc")
Where("bb.expired_at >= ?", time.Now()).
Order("bor.expiration_time desc").
Where("bor.uuid = ?", req.OrderUUID).Where("bb.order_uuid = ?", req.OrderUUID)
err = session.First(&data).Error
return
}
func GetBundleOrderListByUserId(userId int32) (orderItemList []model.BundleOrderItem, err error) {
currentMonth := time.Now().Format("2006-01")
timeNow := time.Now().Format("2006-01-02 15:04:05")
err = app.ModuleClients.BundleDB.Table("bundle_balance").
Select("bundle_balance.order_uuid,bundle_balance.bundle_type,bor.purchase_type").
Joins("INNER JOIN bundle_order_records as bor ON bundle_balance.order_uuid = bor.uuid").
Where("user_id = ? and expired_at >= ?", userId, timeNow).
Where("month = ?", currentMonth).Where("deleted_at is null").
Find(&orderItemList).Error
if err != nil {
return nil, err
}
return orderItemList, nil
}
func GetBundleBalanceByOrderUuid(orderUuid string) (data model.BundleBalance, err error) {
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Where("order_uuid = ?", orderUuid).First(&data).Error
if err != nil {
@ -193,7 +307,7 @@ func AddBundleBalanceByUserId(data model.BundleBalanceUsePo) (usedType int, err
return errors.New("套餐未激活")
}
oldData := model.BundleBalance{}
if err := tx.Model(&model.BundleBalance{}).Where("user_id = ?", data.UserId).Where("month = ?", time.Now().Format("2006-01")).Order("created_at desc").First(&oldData).Error; err != nil {
if err := tx.Model(&model.BundleBalance{}).Where("user_id = ? and order_uuid = ?", data.UserId, data.OrderUUID).Where("month = ?", time.Now().Format("2006-01")).Order("created_at desc").First(&oldData).Error; err != nil {
return errors.New("用户还没有套餐信息")
}
if data.AccountNumber > 0 { // 增加账号消耗数
@ -478,7 +592,9 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLogPo, to
Table("cast_cost_log ccl").
Select("ccl.*,cwe.cost_type").
Joins("left join cast_work_extra cwe on cwe.work_uuid = ccl.work_uuid").
Where("cwe.deleted_at = 0 and ccl.deleted_at = 0")
Joins("left join bundle_order_records bor on bor.uuid = cwe.bundle_order_uuid").
Where("bor.order_type = ?", req.BundleType).
Where("cwe.deleted_at = 0 and ccl.deleted_at = 0 and bor.deleted_at is null")
if req.WorkTitle != "" {
session = session.Where("ccl.work_title like ?", "%"+req.WorkTitle+"%")
}
@ -930,7 +1046,7 @@ left join (
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, error) {
data := &model.BundleBalanceLayout{}
if err := app.ModuleClients.BundleDB.Model(&model.BundleBalanceLayout{}).Where("user_id = ?", req.UserId).First(data).Error; err != nil {
if err := app.ModuleClients.BundleDB.Model(&model.BundleBalanceLayout{}).Where("user_id = ? AND bundle_type = ?", req.UserId, req.BundleType).First(data).Error; err != nil {
return "nil", err
}
return data.Data, nil
@ -938,7 +1054,7 @@ func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, erro
func SetBundleBalanceLayout(req *bundle.SetBundleBalanceLayoutReq) error {
return app.ModuleClients.BundleDB.Clauses(clause.OnConflict{
Columns: []clause.Column{{Name: "user_id"}},
Columns: []clause.Column{{Name: "user_id"}, {Name: "bundle_type"}},
DoUpdates: clause.AssignmentColumns([]string{"data"}),
}).Create(&model.BundleBalanceLayout{Data: req.Data, UserId: uint64(req.UserId)}).Error
}).Create(&model.BundleBalanceLayout{Data: req.Data, UserId: uint64(req.UserId), BundleType: req.BundleType}).Error
}

View File

@ -22,7 +22,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
subQuery := app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
Select("TRUNCATE(COALESCE(SUM(CAST(handling_fee AS DECIMAL(12,3))), 0), 3) as total_fee_payment_amount").
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
Where("bor.deleted_at is null and bor.status=2")
Where("bor.deleted_at is null and bor.status=2 and bor.order_type = 1")
// if req.BundleUuid != "" {
// subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
// }
@ -33,7 +33,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
TRUNCATE(COALESCE(SUM(total_amount), 0) - COALESCE(SUM(amount), 0), 3) as total_increase_payment_amount,
(?) as total_fee_payment_amount
`, subQuery).
Where("deleted_at IS NULL and status=2")
Where("deleted_at IS NULL and status=2 and order_type = 1")
// if req.BundleUuid != "" {
// query = query.Where("bundle_uuid = ?", req.BundleUuid)
// }
@ -76,7 +76,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00").
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null")
Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null and bor.order_type = 1")
if req.BundleUuid != "" {
subQuery = subQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
}
@ -95,7 +95,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
`).
Where("`bundle_order_records`.pay_time >= ?", req.Start+" 00:00:00").
Where("`bundle_order_records`.pay_time <= ?", req.End+" 23:59:59").
Where("`bundle_order_records`.deleted_at is null and bundle_order_records.pay_time != ''")
Where("`bundle_order_records`.deleted_at is null and bundle_order_records.pay_time != '' and bundle_order_records.order_type = 1")
if req.BundleUuid != "" {
query = query.Where("bundle_uuid = ?", req.BundleUuid)
}
@ -119,7 +119,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
countQuery := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("pay_time >= ?", req.Start+" 00:00:00").
Where("pay_time <= ?", req.End+" 23:59:59").
Where("deleted_at is null and status = 2")
Where("deleted_at is null and status = 2 and order_type = 1")
if req.BundleUuid != "" {
countQuery = countQuery.Where("bundle_uuid = ?", req.BundleUuid)
}
@ -131,7 +131,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
// ---------- 重复购买套餐数 ----------
subQuery = app.ModuleClients.BundleDB.Table("bundle_order_records AS bor2").
Select("1").
Where("bor.customer_id = bor2.customer_id and bor2.created_at < bor.pay_time and bor2.deleted_at is null and bor.status=2 and bor.uuid != bor2.uuid")
Where("bor.customer_id = bor2.customer_id and bor2.created_at < bor.pay_time and bor2.deleted_at is null and bor2.order_type = 1 and bor.status=2 and bor.uuid != bor2.uuid")
if req.BundleUuid != "" {
subQuery = subQuery.Where("bundle_uuid = ?", req.BundleUuid)
}
@ -140,7 +140,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Where("EXISTS (?)", subQuery).
Where("bor.pay_time >= ?", req.Start+" 00:00:00").
Where("bor.pay_time <= ?", req.End+" 23:59:59").
Where("bor.deleted_at is null and bor.status=2")
Where("bor.deleted_at is null and bor.status=2 and bor.order_type = 1")
if req.BundleUuid != "" {
repoQuery = repoQuery.Where("bor.bundle_uuid = ?", req.BundleUuid)
}
@ -156,6 +156,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
var newIncreaseCount int64
incQuery := app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
Where("bor.order_type = 1").
Where("`bundle_order_value_add`.created_at >= ?", req.Start+" 00:00:00").
Where("`bundle_order_value_add`.created_at <= ?", req.End+" 23:59:59").
Where("`bundle_order_value_add`.deleted_at is null and `bundle_order_value_add`.payment_status = 2 and `bundle_order_value_add`.equity_type = 2 and bor.status=2 and bor.deleted_at is null")
@ -171,6 +172,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
subQuery = app.ModuleClients.BundleDB.Table("bundle_order_value_add AS bova2").
Select("1").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
Where("bor.order_type = 1").
Where("bova.customer_id = bova2.customer_id and bova2.created_at < bova.created_at and bova2.deleted_at is null and bova2.payment_status = 2 and bova2.equity_type = 2 and bova2.order_uuid != bova.order_uuid and bor.status=2 and bor.deleted_at is null")
if req.BundleUuid != "" {
subQuery = subQuery.Where("bundle_uuid = ?", req.BundleUuid)
@ -178,6 +180,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
repoQuery = app.ModuleClients.BundleDB.Table("bundle_order_value_add AS bova").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
Where("bor.order_type = 1").
Where("EXISTS (?)", subQuery).
Where("bova.created_at >= ?", req.Start+" 00:00:00").
Where("bova.created_at <= ?", req.End+" 23:59:59").
@ -198,7 +201,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Joins("INNER JOIN cast_work_log cwl on cwl.work_uuid = cast_work.uuid and cwl.work_status = 9").
Where("cwe.cost_type = 1").
Where("cwe.cost_type = 1 and cwe.billing_type = 0").
Where("cast_work.work_category = 2").
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
Where("cwl.update_time <= ?", req.End+" 23:59:59").
@ -218,7 +221,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Joins("INNER JOIN cast_work_log cwl on cwl.work_uuid = cast_work.uuid and cwl.work_status = 9").
Where("cwe.cost_type != 1").
Where("cwe.cost_type != 1 and cwe.billing_type = 0").
Where("cast_work.work_category = 2").
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
Where("cwl.update_time <= ?", req.End+" 23:59:59").
@ -249,7 +252,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
`).
Joins("left join cast_work_extra as cwe on cwe.work_uuid = cw.uuid").
Joins("LEFT JOIN cast_work_log AS cwl ON cwl.work_uuid = cw.uuid and cwl.work_status = 9").
Where("cwl.work_status = 9").
Where("cwl.work_status = 9 and cwe.billing_type = 0").
Where("cwe.cost_type in ?", []int{1, 2}).
Where("cw.work_category = ?", 2).
Where("cw.status in ?", []int{7, 6, 9}).
@ -274,6 +277,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join (?) as nb on bb.user_id = nb.user_id", newMonthSubQuery).
Joins("left join (?) as ws on ws.artist_uuid COLLATE utf8mb4_general_ci = CAST(bb.user_id AS CHAR) COLLATE utf8mb4_general_ci", workStatsSubQuery).
Where("nb.new_month = bb.month").
Where("bor.order_type = 1").
Where("bb.deleted_at is null").
Where("bor.deleted_at is null")
@ -315,7 +319,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
SUM(CASE WHEN ccl.uuid IS NULL THEN 1 ELSE 0 END) AS un_used_video
`).
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Where("cast_work.work_category = 2").
Joins("left join cast_work_extra as cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.work_category = 2 and cwe.billing_type = 0").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
@ -336,7 +341,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("LEFT JOIN cast_work_extra cwe ON cwe.work_uuid = cast_work.uuid").
Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
Where("cast_work.work_category = 2").
Where("cast_work.work_category = 2 and cwe.billing_type = 0").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
@ -353,8 +358,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 2"). // 视频类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.work_category = 2"). // 视频类型
Where("cwe.cost_type = 1 and cwe.billing_type = 0"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
@ -371,8 +376,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 2"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.work_category = 2 and cwe.billing_type = 0"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
@ -420,7 +425,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci = cma.artist_uuid COLLATE utf8mb4_general_ci ").
Where("cma.created_at >= ?", timeParse(req.Start+" 00:00:00").Unix()).
Where("cma.created_at <= ?", timeParse(req.End+" 23:59:59").Unix()).
Where("cma.deleted_at = 0 and bor.deleted_at is null").
Where("cma.deleted_at = 0 and bor.deleted_at is null and bor.order_type = 1").
Group("cma.user_id")
if req.BundleUuid != "" {
@ -434,7 +439,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
query = app.ModuleClients.BundleDB.Table("cast_media_account AS cma").
Joins("left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci = cma.artist_uuid COLLATE utf8mb4_general_ci ").
Where("cma.created_at <= ?", timeParse(req.End+" 23:59:59").Unix()).
Where("cma.deleted_at = 0 and bor.deleted_at is null")
Where("cma.deleted_at = 0 and bor.deleted_at is null and bor.order_type = 1")
if req.BundleUuid != "" {
query = query.Where("bor.bundle_uuid = ?", req.BundleUuid)
}
@ -455,7 +460,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
SUM(CASE WHEN ccl.uuid IS NULL THEN 1 ELSE 0 END) AS un_used_image
`).
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid").
Where("cast_work.work_category = 1").
Joins("left join cast_work_extra as cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.work_category = 1 and cwe.billing_type = 0").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
@ -475,7 +481,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("LEFT JOIN cast_work_extra cwe ON cwe.work_uuid = cast_work.uuid ").
Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
Where("cast_work.work_category = 1").
Where("cast_work.work_category = 1 and cwe.billing_type = 0").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.origin_uuid = ''").
@ -492,8 +498,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 1"). // 图文类型
Where("cwe.cost_type = 1 "). // 套餐类型
Where("cast_work.work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cwe.cost_type = 1 "). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
@ -510,8 +516,8 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
Joins("left join cast_cost_log ccl on ccl.work_uuid = cast_work.uuid AND ccl.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("cast_work.work_category = 1"). // 图文类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0")
@ -742,10 +748,10 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
//====================视频=======================
var newUploadedBundleVideoCount int64
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
Where("cast_work.origin_uuid = ''").
// Where("cwe.cost_type = 1"). // 套餐类型
Where("deleted_at = 0").
@ -764,9 +770,9 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
var totalUploadedVideoCount int64
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
Where("cast_work.origin_uuid = ''").
// Where("cwe.cost_type = 1"). // 套餐类型
Where("deleted_at = 0").
@ -777,8 +783,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
@ -788,8 +794,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 2"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
@ -814,10 +820,10 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
//====================图文=======================
var newUploadedBundleImageCount int64
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time >= ?", req.Start+" 00:00:00").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cast_work.origin_uuid = ''").
// Where("cwe.cost_type = 1"). // 套餐类型
Where("deleted_at = 0").
@ -836,9 +842,9 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
var totalUploadedImageCount int64
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
// Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cast_work.origin_uuid = ''").
Where("cast_work.status != 8").
// Where("cwe.cost_type = 2"). // 套餐类型
@ -850,8 +856,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cwe.cost_type = 1"). // 套餐类型
Where("cast_work.status != 8").
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
@ -861,8 +867,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid AND cwe.deleted_at = 0").
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
Where("work_category = 1"). // 图文类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
Where("cast_work.origin_uuid = ''").
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
Count(&totalUploadedIncreaseImageCount)
@ -996,7 +1002,9 @@ func manualIncreaseBundleBalance(startTime string, endTime string, bundleUUID st
// 通过 order_uuid 联表 bundle_order_records 获取 bundle_uuid
Joins("left join bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.deleted_at is null and bor.status = 2").
// 支持 bundle_uuid 过滤
Where("bor.bundle_uuid = ?", bundleUUID)
Where("bor.bundle_uuid = ?", bundleUUID).
// 只统计订单类型为基础套餐的数据,避免统计到先用后付订单
Where("bor.order_type = 1")
}
if err = quary.Scan(&data).Error; err != nil {
return
@ -1031,15 +1039,17 @@ func balanceInfoWithShop(startMonth string, endMonth string, startTime string, e
bb.monthly_bundle_limit_expired_competitive_number
) AS competitive
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 = 新增待上传数量
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
Joins(`INNER JOIN (
SELECT order_uuid, MIN(created_at) AS min_created_at
FROM bundle_balance
WHERE deleted_at IS NULL
GROUP BY order_uuid
) AS bb_min ON bb.order_uuid = bb_min.order_uuid AND bb.created_at = bb_min.min_created_at`).
Where("bor.deleted_at is null and bor.status=2").
Where("bor.deleted_at is null").
Where("(bor.order_mode = 1 and bor.status=2) OR (bor.order_mode = 2)").
Where("bb.month = DATE_FORMAT(bb.start_at, '%Y-%m')").
Where("bor.order_type = ?", model.BundleTypeBasic).
Where("bb.deleted_at IS NULL")
if bundleUUID != "" {
subQuery = subQuery.Where("bor.bundle_uuid = ?", bundleUUID)
@ -1092,14 +1102,16 @@ func IncreasealanceInfoWithShop(startMonth string, endMonth string, startTime st
bb.monthly_increase_limit_expired_competitive_number
) AS competitive
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 = 新增待上传数量
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
Joins(`INNER JOIN (
SELECT order_uuid, MIN(created_at) AS min_created_at
FROM bundle_balance
WHERE deleted_at IS NULL
GROUP BY order_uuid
) AS bb_min ON bb.order_uuid = bb_min.order_uuid AND bb.created_at = bb_min.min_created_at`).
Where("bor.deleted_at is null and bor.status=2").
Where("bor.deleted_at is null").
Where("bor.order_type = ?", model.BundleTypeBasic).
Where("(bor.order_mode = 1 and bor.status=2) OR (bor.order_mode = 2)").
Where("bb.month = DATE_FORMAT(bb.start_at, '%Y-%m')").
Where("bb.deleted_at IS NULL")
if bundleUUID != "" {
@ -1183,7 +1195,7 @@ func getBundleBalanceInfo(month string, bundleUUID string, endTime string) (data
bb.monthly_bundle_limit_competitive_consumption_number
) AS competitive
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 + 限制不过期类型的总共已用 + 限制过期类型的总共已用 + 已过期的数量 = 总发放数
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
Where("bor.deleted_at is null and bor.status=2").
Joins(`INNER JOIN (
SELECT
@ -1269,7 +1281,7 @@ func getIncreaseBalanceInfo(month string, bundleUUID string, endTime string) (da
bb.monthly_increase_limit_competitive_consumption_number
) AS competitive
`). // 不限制类型的总数 + 限制不过期类型的当月可用 + 限制过期类型的当月可用 + 限制不过期类型的总共已用 + 限制过期类型的总共已用 + 已过期的数量 = 总发放数
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid and bor.order_type = ?", model.BundleTypeBasic).
Joins(`INNER JOIN (
SELECT
bb_inner.user_id,
@ -1312,7 +1324,10 @@ func getIncreaseBalanceInfo(month string, bundleUUID string, endTime string) (da
func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle.MetricsOperatingStatusResp, err error) {
data = &bundle.MetricsOperatingStatusResp{}
var statistic = func(status int8, workCategory int8) (i int64) {
app.ModuleClients.BundleDB.Model(model.CastWork{}).Where(model.CastWork{Status: status, WorkCategory: workCategory}).Where("deleted_at = 0 and submit_time <= ?", req.Date+" 23:59:59").Count(&i)
app.ModuleClients.BundleDB.Model(model.CastWork{}).Where(model.CastWork{Status: status, WorkCategory: workCategory}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cwe.billing_type = 0"). // 只统计套餐类型的作品
Where("deleted_at = 0 and submit_time <= ?", req.Date+" 23:59:59").Count(&i)
return
}
//视频
@ -1329,10 +1344,12 @@ func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cast_work.status in (9,6) and cast_work.work_category = 2 and cwe.confirm_type = 1").
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
Where("cw.billing_type = 0"). // 只统计套餐类型的作品
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
Count(&data.ArtistConfirmVideoCount)
app.ModuleClients.BundleDB.Model(model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cw.billing_type = 0"). // 只统计套餐类型的作品
Where("cast_work.status in (9,6) and cast_work.work_category = 2 and cwe.confirm_type = 2").
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
@ -1350,12 +1367,14 @@ func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle
app.ModuleClients.BundleDB.Model(model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cw.billing_type = 0"). // 只统计套餐类型的作品
Where("cast_work.status in (9,6) and cast_work.work_category = 1 and cwe.confirm_type = 1").
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
Count(&data.ArtistConfirmImageCount)
app.ModuleClients.BundleDB.Model(model.CastWork{}).
Joins("left join cast_work_extra cwe on cwe.work_uuid = cast_work.uuid").
Where("cw.billing_type = 0"). // 只统计套餐类型的作品
Where("cast_work.status in (9,6) and cast_work.work_category = 1 and cwe.confirm_type = 2").
Where("cast_work.submit_time <= ?", req.Date+" 23:59:59").
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
@ -1458,7 +1477,7 @@ func MetricsBundlePurchaseExport(req *bundle.MetricsBundlePurchaseExportReq) (*b
where a1.deleted_at is null and a1.status = 2 and a1.total_amount > 300 and a2.deleted_at is null
group by a1.order_no
) t4 on t1.order_no = t4.order_no
where t1.deleted_at is null and t1.status = 2 and t1.total_amount > 300
where t1.deleted_at is null and t1.status = 2 and t1.total_amount > 300 and t1.order_type = 1 and t1.order_type = 1
order by t2.sub_num asc`,
"`micro-account`.`user`",
"`micro-account`.`real_name`")
@ -1564,6 +1583,7 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
Joins(`left join (Select * from cast_media_account where platform_id = 5 and deleted_at = 0 and expired != 2) bluesky on bluesky.artist_uuid = cma.artist_uuid`).
Joins(`left join (Select * from cast_media_auth where platform_id = 5 and deleted_at = 0) bluesky_auth on bluesky_auth.user_id = bluesky.user_id`).
Joins(`left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci= cma.artist_uuid COLLATE utf8mb4_general_ci`).
Where("bor.order_type = ?", model.BundleTypeBasic).
Where("bor.deleted_at is null")
err = query.Find(&data.Data).Error
if err != nil {
@ -1587,6 +1607,7 @@ func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 4) dm on dm.work_uuid = cw.uuid").
Joins("left join (select created_at,work_uuid from cast_work_platform_info cwi where cwi.platform_id = 3) ins on ins.work_uuid = cw.uuid").
Joins("left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci").
Where("bor.order_type = ?", model.BundleTypeBasic).
Where("(tiktok.created_at is not null or dm.created_at is not null or ins.created_at is not null) and cw.deleted_at = 0 and bor.deleted_at is null and cw.origin_uuid = ''").
Order("cw.artist_name")
} else {
@ -1644,6 +1665,7 @@ func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *
}
query = query.Joins(`LEFT JOIN bundle_order_records bor ON bor.customer_id COLLATE utf8mb4_general_ci = cw.artist_uuid COLLATE utf8mb4_general_ci AND bor.deleted_at IS NULL`).
Where(`cw.deleted_at = 0 AND (tiktok.created_at IS NOT NULL OR dm.created_at IS NOT NULL OR ins.created_at IS NOT NULL)`).
Where("bor.order_type = ?", model.BundleTypeBasic).
Order("cw.artist_name")
}
err = query.Find(&result.Data).Error
@ -1694,6 +1716,7 @@ func getMonthlyRelease(month string, bundleUuid string) (bundleBalanceInfo Balan
query := app.ModuleClients.BundleDB.Table("bundle_balance as bb").
Joins("left join bundle_order_records bor on bor.uuid = bb.order_uuid").
Where("bb.`month` = ?", datetime.AddMonth(t, -1).Format("2006-01")).
Where("bor.order_type = ?", model.BundleTypeBasic).
Where("bor.deleted_at is null and bb.deleted_at is null")
if bundleUuid != "" {
query = query.Where("bor.bundle_uuid = ?", bundleUuid)
@ -1755,6 +1778,7 @@ func qua(data model.BundleBalance, total, limit int, date time.Time) int {
return 0
}
// 临时接口,不在正逻辑中使用
func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCastInfoResp, error) {
result := &bundle.ExportWorkCastInfoResp{}
query := app.ModuleClients.BundleDB.Raw(`
@ -1788,6 +1812,7 @@ func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCa
WHERE bb.deleted_at IS NULL
AND bb.month = '2026-01'
AND bor.deleted_at IS NULL
AND bor.order_type = 1
AND cw.title IS NOT NULL
AND cw.submit_time < ?
AND cw.submit_time > ?

View File

@ -127,9 +127,9 @@ func UpdateAllValueAddServiceLangServiceType(tx *gorm.DB, columns map[string]int
// 增值套餐列表
func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res []*model.ValueAddService, total int64, err error) {
query := app.ModuleClients.BundleDB.Model(&model.ValueAddService{}).
Where("deleted_at = 0")
Where("deleted_at = 0").Where("source_from = ?", req.SourceFrom)
// 使用子查询筛选符合条件的UUID
// 使用子查询筛选符合条件的UUID
if req.Name != "" || req.ServiceType != 0 {
subQuery := app.ModuleClients.BundleDB.Model(&model.ValueAddServiceLang{}).
Select("uuid").

View File

@ -96,6 +96,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
PayTime: m.PayTime,
StartTime: m.StartAt.UnixMilli(),
Status: int32(m.Status),
BundleType: int64(m.BundleType),
BundleName: m.BundleName,
Month: m.Month,
ExpiredTime: m.ExpiredAt.UnixMilli(),
@ -207,6 +208,41 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
return resp, nil
}
func GetPayLaterBundleBalanceList(req *bundle.GetPayLaterBundleBalanceListReq) (*bundle.GetPayLaterBundleBalanceListResp, error) {
data, total, err := dao.GetPayLaterBundleBalanceList(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
resp := &bundle.GetPayLaterBundleBalanceListResp{}
resp.Total = total
resp.Data = lo.Map(data, func(m model.PayLaterBundleBalancePo, _ int) *bundle.PayLaterBundleBalanceItem {
result := &bundle.PayLaterBundleBalanceItem{
UserId: int32(m.UserId),
Activate: int32(m.Activate),
UserName: m.UserName,
UserPhoneNumber: m.UserPhoneNumber,
CustomerNum: m.CustomerNum,
PayTime: m.PayTime,
BundleName: m.BundleName,
ExpiredTime: m.ExpiredAt.UnixMilli(),
// 无限制增值视频统计(所有未过期 bundle_type=2 套餐求和)
BundleVideoSumNumber: m.BundleVideoSumNumber, // 视频总数
BundleVideoNumber: m.BundleVideoNumber, // 可用视频数
BundleVideoConsumptionNumber: m.BundleVideoConsumptionNumber, // 已用视频数
BundleVideoInvalidNumber: m.BundleVideoInvalidNumber, // 作废视频数
MonthlyBundleVideoNumber: m.MonthlyBundleVideoNumber, // 当月可用视频数
MonthlyBundleVideoConsumptionNumber: m.MonthlyBundleVideoConsumptionNumber, // 当月已用视频数
MonthlyBundleVideoInvalidNumber: m.MonthlyBundleVideoInvalidNumber, // 当月作废视频数
}
if result.Activate != 2 { // 除了等于2(已激活)的情况统一为1
result.Activate = 1
}
return result
})
return resp, nil
}
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
data, err := dao.GetBundleBalanceByUserId(req)
if err != nil {
@ -262,6 +298,23 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.
return result, nil
}
func GetBundleOrderListByUserId(req *bundle.GetBundleOrderListByUserIdReq) (*bundle.GetBundleOrderListByUserIdResp, error) {
orderItemList, err := dao.GetBundleOrderListByUserId(req.UserId)
if err != nil {
logger.Error(err)
return nil, errors.New("查询订单列表失败")
}
resp := &bundle.GetBundleOrderListByUserIdResp{}
resp.OrderItem = lo.Map(orderItemList, func(m model.BundleOrderItem, _ int) *bundle.BalanceOrderItem {
return &bundle.BalanceOrderItem{
OrderUuid: m.OrderUUID,
BundleType: m.BundleType,
PurchaseType: m.PurchaseType,
}
})
return resp, nil
}
// 获取最初非续费套餐订单的开始时间
// 查询失败返回2 和 默认事件
func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
@ -286,6 +339,7 @@ func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
data := model.BundleBalanceUsePo{
UserId: int(req.UserId),
OrderUUID: req.OrderUUID,
AccountNumber: int(req.AccountConsumptionNumber),
ImageNumber: int(req.ImageConsumptionNumber),
VideoNumber: int(req.VideoConsumptionNumber),
@ -541,6 +595,7 @@ func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBund
data.MonthlyBundleLimitCompetitiveNumber = cal(data, data.BundleLimitCompetitiveNumber, data.MonthlyLimitCompetitiveQuotaNumber, now)
data.MonthlyIncreaseLimitCompetitiveNumber = cal(data, data.IncreaseLimitCompetitiveNumber, data.MonthlyLimitCompetitiveQuotaNumber, now)
data.BundleType = int(orderInfo.OrderType)
err = dao.CreateBundleBalance(data)
if err != nil {
logger.Error(err)
@ -710,9 +765,32 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
}
func PayLaterBundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.PayLaterBundleBalanceExportResp, error) {
data, err := GetPayLaterBundleBalanceList(&bundle.GetPayLaterBundleBalanceListReq{
Month: req.Month,
UserName: req.UserName,
ExpiredTimeStart: int64(req.ExpiredTimeStart),
ExpiredTimeEnd: int64(req.ExpiredTimeEnd),
Page: 1,
PageSize: 99999,
})
if err != nil {
return nil, errors.New("先用后付套餐余量导出失败")
}
return &bundle.PayLaterBundleBalanceExportResp{
Total: data.Total,
Data: data.Data,
}, nil
}
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (*bundle.GetBundleBalanceLayoutResp, error) {
data, err := dao.GetBundleBalanceLayout(req)
if err != nil { // 返回默认值
if req.BundleType == 2 {
return &bundle.GetBundleBalanceLayoutResp{
Data: buildDefaultPayLaterBalanceLayout(),
}, nil
}
return &bundle.GetBundleBalanceLayoutResp{
Data: buildDefaultBalanceLayout(),
}, nil
@ -833,3 +911,39 @@ func buildDefaultBalanceLayout() string {
b, _ := json.Marshal(jsonMap)
return string(b)
}
func buildDefaultPayLaterBalanceLayout() string {
var data = []struct {
Title string
Column string
Status int
}{
{"是否激活", "activate", 1},
{"艺人", "userName", 1},
{"艺人手机号", "userPhoneNumber", 1},
{"用户编号", "customerNum", 1},
{"最后购买的套餐", "bundleName", 1},
{"最新下单时间", "payTime", 1},
{"过期时间", "expiredTime", 1},
{"视频总数", "bundleVideoSumNumber", 1},
{"可用视频数", "bundleVideoNumber", 1},
{"已用视频数", "bundleVideoConsumptionNumber", 1},
{"作废视频数", "bundleVideoInvalidNumber", 1},
{"当月可用视频数", "monthlyBundleVideoNumber", 1},
{"当月已用视频数", "monthlyBundleVideoConsumptionNumber", 1},
{"当月作废视频数", "monthlyBundleVideoInvalidNumber", 1},
}
jsonMap := []map[string]any{}
for _, v := range data {
jsonMap = append(jsonMap, map[string]any{
"sort": 1,
"fieldKey": v.Column,
"fieldValue": v.Title,
"sortOrNot": true,
"status": v.Status,
"width": 160,
})
}
b, _ := json.Marshal(jsonMap)
return string(b)
}

View File

@ -68,17 +68,20 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
}
//套餐主表数据
bundleProfile := &model.BundleProfile{
Name: req.Name,
Sort: req.Sort,
Content: req.Content,
Price: req.Price,
PriceType: req.PriceType,
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
ImgOption: int8(req.ImgOption),
BgImg1: req.BgImg1,
BgImg2: req.BgImg2,
ShelfStatus: 2, //默认初始状态为2-下架
FontColor: req.FontColor,
Name: req.Name,
Sort: req.Sort,
Content: req.Content,
Price: req.Price,
PriceType: req.PriceType,
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
PayLaterContract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/20260611-套餐的先用后付合同.pdf",
ImgOption: int8(req.ImgOption),
BgImg1: req.BgImg1,
BgImg2: req.BgImg2,
ShelfStatus: model.BundleShelfStatusDown, //默认初始状态为2-下架
FontColor: req.FontColor,
BundleType: req.BundleType,
PayLaterTime: req.PayLaterTime,
}
bundleLang := &model.BundleProfileLang{
Name: req.Name,
@ -202,6 +205,8 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
serviceName = "账号数"
case msg.AvailableTimeService:
serviceName = "可用时长"
case msg.CompetitiveService:
serviceName = "竞品数"
}
return res, fmt.Errorf("服务类型%s的额度不兼容套餐权益额度为%d附加权益额度为%d",
serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue)
@ -288,15 +293,17 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
}
if req.Language == msg.ZH_CN {
updateBundle := map[string]interface{}{
"name": req.Name,
"sort": req.Sort,
"content": req.Content,
"price": req.Price,
"price_type": req.PriceType,
"img_option": req.ImgOption,
"bg_img1": req.BgImg1,
"bg_img2": req.BgImg2,
"font_color": req.FontColor,
"name": req.Name,
"sort": req.Sort,
"content": req.Content,
"price": req.Price,
"price_type": req.PriceType,
"img_option": req.ImgOption,
"bg_img1": req.BgImg1,
"bg_img2": req.BgImg2,
"font_color": req.FontColor,
"bundle_type": req.BundleType,
"pay_later_time": req.PayLaterTime,
}
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
return res, errors.New("更新套餐信息失败")
@ -333,6 +340,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
res = new(bundle.BundleDetailResponseV2)
bundleProfile := &bundle.BundleProfile{}
var bundleProfileLang *bundle.BundleProfileLang
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
@ -341,22 +349,56 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
if err != nil {
return res, errors.New("获取套餐信息失败")
}
if req.Language != "" {
for _, lang := range detail.BundleProfileLang {
if lang.Language == req.Language {
bundleProfileLang = &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
PayLaterTime: lang.PayLaterTime,
}
break
}
}
} else {
//默认返回中文数据
for _, lang := range detail.BundleProfileLang {
if lang.Language == msg.ZH_CN {
bundleProfileLang = &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
PayLaterTime: lang.PayLaterTime,
}
break
}
}
}
if detail != nil {
bundleProfile = &bundle.BundleProfile{
Uuid: detail.UUID,
Name: detail.Name,
Content: detail.Content,
Price: detail.Price,
PriceType: detail.PriceType,
ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2,
FontColor: detail.FontColor,
Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus,
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
Contract: detail.Contract,
Uuid: detail.UUID,
Name: bundleProfileLang.Name,
Content: bundleProfileLang.Content,
Price: bundleProfileLang.Price,
PriceType: bundleProfileLang.PriceType,
ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2,
Language: req.Language,
FontColor: detail.FontColor,
Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus,
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
Contract: detail.Contract,
PayLaterContract: detail.PayLaterContract,
BundleType: int64(detail.BundleType),
PayLaterTime: int64(bundleProfileLang.PayLaterTime),
}
if len(detail.BundleToValueAddService) > 0 {
var valueUuids []string
@ -421,20 +463,22 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0, len(detail.BundleProfileLang))
for _, lang := range detail.BundleProfileLang {
bundleProfileLangs = append(bundleProfileLangs, &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
Language: lang.Language,
ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2,
FontColor: detail.FontColor,
Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus,
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
Language: lang.Language,
PayLaterTime: int64(lang.PayLaterTime),
ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2,
FontColor: detail.FontColor,
Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus,
BundleType: int64(detail.BundleType),
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
})
}
bundleProfile.BundleProfileLang = bundleProfileLangs
@ -469,6 +513,9 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
res.Sort = detail.Sort
res.ShelfStatus = detail.ShelfStatus
res.Contract = detail.Contract
res.PayLaterContract = detail.PayLaterContract
res.BundleType = int64(detail.BundleType)
res.PayLaterTime = int64(detail.PayLaterTime)
if len(detail.BundleToValueAddService) > 0 {
var serviceLangInfos []*bundle.ServiceLangInfo
for _, service := range detail.BundleToValueAddService {
@ -486,6 +533,7 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
res.PriceType = lang.PriceType
res.Content = lang.Content
res.Language = lang.Language
res.PayLaterTime = int64(lang.PayLaterTime)
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
}

View File

@ -214,6 +214,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
valueAddService := &model.ValueAddService{
ServiceName: in.ServiceName,
ServiceType: in.ServiceType,
SourceFrom: in.SourceFrom,
}
valueAddServiceLang := &model.ValueAddServiceLang{
ServiceName: in.ServiceName,

View File

@ -8,13 +8,24 @@ import (
"gorm.io/plugin/soft_delete"
)
const (
BundleTypeBasic = 1 // 基础套餐
BundleTypePostpaid = 2 // 先用后付套餐
)
const (
BundleShelfStatusUp = 1 // 上架
BundleShelfStatusDown = 2 // 下架
)
type BundleProfile struct {
gorm.Model
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
Contract string `json:"contract" gorm:"type:varchar(1024);comment:合同"`
Contract string `json:"contract" gorm:"type:varchar(1024);comment:普通套餐合同"`
PayLaterContract string `json:"payLaterContract" gorm:"type:varchar(1024);comment:先用后付套餐合同"`
ContractDuration int `json:"contractDuration" gorm:"column:contract_duration;type:int;comment:合同有效时长"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
CompanySign string `json:"companySign" gorm:"column:company_sign;type:varchar(1024);comment:公司签名"`
@ -27,20 +38,23 @@ type BundleProfile struct {
FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);comment:字体颜色"`
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
BundleType int64 `json:"bundleType" gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"`
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
}
type BundleProfileLang struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
type BundleToValueAddService struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
@ -158,6 +172,25 @@ type BundleBalancePo struct {
BundleBalance
}
type PayLaterBundleBalancePo struct {
UserId int `gorm:"column:user_id"`
UserName string `gorm:"column:user_name"`
UserPhoneNumber string `gorm:"column:user_phone_number"`
BundleName string `gorm:"column:bundle_name"`
OrderUUID string `gorm:"column:order_uuid"`
Activate int `gorm:"column:activate"`
CustomerNum string `gorm:"column:customer_num"`
PayTime string `gorm:"column:pay_time"`
ExpiredAt time.Time `gorm:"column:expired_at"`
BundleVideoSumNumber int32 `gorm:"column:bundle_video_sum_number"` // 视频总数
BundleVideoConsumptionNumber int32 `gorm:"column:bundle_video_consumption_number"` // 已用视频数
BundleVideoNumber int32 `gorm:"column:bundle_video_number"` // 可用视频数
BundleVideoInvalidNumber int32 `gorm:"column:bundle_video_invalid_number"` // 作废视频数
MonthlyBundleVideoConsumptionNumber int32 `gorm:"column:monthly_bundle_video_consumption_number"` // 当月已用视频数
MonthlyBundleVideoInvalidNumber int32 `gorm:"column:monthly_bundle_video_invalid_number"` // 当月作废视频数
MonthlyBundleVideoNumber int32 `gorm:"column:monthly_bundle_video_number"` // 当月可用视频数
}
type UserBundleBalancePo struct {
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
@ -173,13 +206,20 @@ type UserBundleBalancePo struct {
BundleBalance
}
type BundleOrderItem struct {
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
PurchaseType int64 `json:"purchaseType" gorm:"column:purchase_type"`
BundleType int64 `json:"bundleType" gorm:"column:bundle_type"`
}
type BundleBalance struct {
gorm.Model
UserId int `gorm:"column:user_id;not null"`
Month string `gorm:"column:month;type:varchar(32);not null;index:idx_month"`
OrderUUID string `gorm:"column:order_uuid;type:varchar(1024);not null;index:idx_order_uuid"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间;index:idx_expired_at"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间;index:idx_start_at"`
UserId int `gorm:"column:user_id;not null"`
Month string `gorm:"column:month;type:varchar(32);not null;index:idx_month"`
OrderUUID string `gorm:"column:order_uuid;type:varchar(1024);not null;index:idx_order_uuid"`
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:套餐过期时间;index:idx_expired_at"`
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:套餐开始时间;index:idx_start_at"`
BundleType int `gorm:"column:bundle_type;type:int;default:1;comment:套餐类型 1:基础套餐 2:先用后付套餐"`
// 套餐与增值账号
BundleAccountNumber int `gorm:"column:bundle_account_number;not null;comment:套餐账号总数"`
@ -347,6 +387,7 @@ func (*BundleActivate) TableName() string {
type BundleBalanceUsePo struct {
UserId int
OrderUUID string
AccountNumber int
VideoNumber int
ImageNumber int
@ -398,8 +439,9 @@ type BundleExport struct {
type BundleBalanceLayout struct {
gorm.Model
UserId uint64 `gorm:"column:user_id;not null;unique"`
Data string `gorm:"column:data;type:longtext;not null"`
UserId uint64 `gorm:"column:user_id;not null;unique"`
Data string `gorm:"column:data;type:longtext;not null"`
BundleType int32 `gorm:"column:bundle_type;not null"`
}
// 总销售情况

View File

@ -35,7 +35,8 @@ type ValueAddService struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
SourceFrom int32 `json:"sourceFrom" gorm:"column:source_from;type:int;default:1;comment:归属 1:普通套餐 2:先用后付套餐"`
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
@ -48,7 +49,7 @@ type ValueAddServiceLang struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长 6:竞品数"`
PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"`
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用

View File

@ -55,13 +55,16 @@ service Bundle {
rpc UpdateBundleBalance(UpdateBundleBalanceReq) returns (UpdateBundleBalanceResp) {} // ()
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} //
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} //
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} //
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} //
rpc GetPayLaterBundleBalanceList(GetPayLaterBundleBalanceListReq) returns (GetPayLaterBundleBalanceListResp) {} //
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} //
rpc GetBundleOrderListByUserId(GetBundleOrderListByUserIdReq) returns (GetBundleOrderListByUserIdResp) {} // ID查询订单列表
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} //
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} //
rpc BundleActivate(BundleActivateReq) returns (BundleActivateResp) {} //
rpc BundleBalanceExport(BundleBalanceExportReq) returns (BundleBalanceExportResp) {} //
rpc BundleBalanceExport(BundleBalanceExportReq) returns (BundleBalanceExportResp) {} //
rpc PayLaterBundleBalanceExport(BundleBalanceExportReq) returns (PayLaterBundleBalanceExportResp) {} //
rpc GetBundleBalanceLayout(GetBundleBalanceLayoutReq) returns (GetBundleBalanceLayoutResp) {} //
rpc SetBundleBalanceLayout(SetBundleBalanceLayoutReq) returns (SetBundleBalanceLayoutResp) {} //
@ -358,21 +361,24 @@ message BundleProfile {
int64 priceType = 4 [json_name = "priceType"];
string content = 5 [json_name = "content"];
string contract = 6 [json_name = "contract"];
string language = 7 [json_name = "language"];
string createdAt = 8 [json_name = "createdAt"];
string updatedAt = 9 [json_name = "updatedAt"];
string companySign = 10 [json_name = "companySign"];
int64 contractDuration = 11 [json_name = "contractDuration"];
string bundleCommonUid = 12 [json_name = "bundleCommonUid"];
int64 sort = 13 [json_name = "sort"];
string bgImg1 = 14 [json_name = "bgImg1"];
string bgImg2 = 15 [json_name = "bgImg2"];
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
repeated SelectValueAdditionalService selectValueAdditionalService = 18 [json_name = "SelectValueAdditionalService"];
repeated BundleProfileLang bundleProfileLang = 19 [json_name = "bundleProfileLang"];
int32 imgOption = 20 [json_name = "imgOption"];
string fontColor = 21 [json_name = "fontColor"];
string payLaterContract = 7 [json_name = "payLaterContract"];
string language = 8 [json_name = "language"];
string createdAt = 9 [json_name = "createdAt"];
string updatedAt = 10 [json_name = "updatedAt"];
string companySign = 11 [json_name = "companySign"];
int64 contractDuration = 12 [json_name = "contractDuration"];
string bundleCommonUid = 13 [json_name = "bundleCommonUid"];
int64 sort = 14 [json_name = "sort"];
string bgImg1 = 15 [json_name = "bgImg1"];
string bgImg2 = 16 [json_name = "bgImg2"];
int64 shelfStatus = 17 [json_name = "shelfStatus"]; // 1 2
repeated SelectValueAddService selectValueAddService = 18 [json_name = "SelectValueAddService"];
repeated SelectValueAdditionalService selectValueAdditionalService = 19 [json_name = "SelectValueAdditionalService"];
repeated BundleProfileLang bundleProfileLang = 20 [json_name = "bundleProfileLang"];
int32 imgOption = 21 [json_name = "imgOption"];
string fontColor = 22 [json_name = "fontColor"];
int64 bundleType = 23 [json_name = "bundleType"];
int64 payLaterTime = 24 [json_name = "payLaterTime"]; //
}
message BundleProfileLang {
string uuid = 1 [json_name = "uuid"];
@ -384,15 +390,18 @@ message BundleProfileLang {
string createdAt = 7 [json_name = "createdAt"];
string updatedAt = 8 [json_name = "updatedAt"];
string contract = 9 [json_name = "contract"];
string companySign = 10 [json_name = "companySign"];
int64 contractDuration = 11 [json_name = "contractDuration"];
string fontColor = 12 [json_name = "fontColor"];
int64 sort = 13 [json_name = "sort"];
string bgImg1 = 14 [json_name = "bgImg1"];
string bgImg2 = 15 [json_name = "bgImg2"];
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2
int32 imgOption = 17 [json_name = "imgOption"];
repeated ServiceLangInfo serviceLangInfo = 18 [json_name = "serviceLangInfo"];//
string payLaterContract = 10 [json_name = "payLaterContract"];
string companySign = 11 [json_name = "companySign"];
int64 contractDuration = 12 [json_name = "contractDuration"];
string fontColor = 13 [json_name = "fontColor"];
int64 sort = 14 [json_name = "sort"];
string bgImg1 = 15 [json_name = "bgImg1"];
string bgImg2 = 16 [json_name = "bgImg2"];
int64 shelfStatus = 17 [json_name = "shelfStatus"]; // 1 2
int32 imgOption = 18 [json_name = "imgOption"];
int64 bundleType = 19 [json_name = "bundleType"];
int64 payLaterTime = 20 [json_name = "payLaterTime"]; //
repeated ServiceLangInfo serviceLangInfo = 21 [json_name = "serviceLangInfo"];//
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
}
@ -441,6 +450,7 @@ message BundleListRequest {
string name = 3 [json_name = "name"];
string content = 4 [json_name = "content"];
string language = 5 [json_name = "language"];
int32 bundleType = 6 [json_name = "bundleType"];
}
message BundleListResponse {
@ -670,6 +680,7 @@ message ValueAddServiceLang {
int32 quotaType = 12 [json_name = "quotaType"]; // 1 2
int32 quotaValue = 13 [json_name = "quotaValue"]; //
bool isExpired = 14 [json_name = "isExpired"]; // false true
int32 sourceFrom = 15 [json_name = "sourceFrom"]; // 1 2
}
//
message ValueAddPriceOptions {
@ -688,6 +699,7 @@ message ValueAddServiceListRequest {
string name = 3 [json_name = "name"]; //
int32 serviceType = 4 [json_name = "serviceType"]; //
string language = 5 [json_name = "language"]; // (使)
int32 sourceFrom = 6 [json_name = "sourceFrom"]; // 1 2
}
message ValueAddServiceListResponse {
int32 total = 1 [json_name = "total"];
@ -794,6 +806,45 @@ message GetBundleBalanceListReq{
int32 pageSize = 10;
repeated string month = 11;
int32 statusType = 12;
int32 bundleType = 13;
}
message GetPayLaterBundleBalanceListReq{
string userName = 1;
int32 status = 2;
string bundleName = 3;
int32 bought = 4;
int64 startTimeStart = 5;
int64 startTimeEnd = 6;
int64 expiredTimeStart = 7;
int64 expiredTimeEnd = 8;
int32 page = 9;
int32 pageSize = 10;
repeated string month = 11;
int32 statusType = 12;
int32 bundleType = 13;
}
message PayLaterBundleBalanceItem {
//
int32 userId = 1;
int32 activate = 2; //
string userName = 3; //
string userPhoneNumber = 4; //
string customerNum = 5; //
string bundleName = 7; //
string payTime = 8; //
int64 expiredTime = 10; //
int32 bundleVideoSumNumber = 11; //
int32 bundleVideoNumber = 12; //
int32 bundleVideoConsumptionNumber = 13; //
int32 bundleVideoInvalidNumber = 14; //
int32 monthlyBundleVideoNumber = 15; //
int32 monthlyBundleVideoConsumptionNumber = 16; //
int32 monthlyBundleVideoInvalidNumber = 17; //
}
message GetPayLaterBundleBalanceListResp{
int64 total = 1;
repeated PayLaterBundleBalanceItem data = 2;
}
message GetBundleBalanceReq{
@ -818,101 +869,102 @@ message BundleBalanceItem {
string payTime = 8; //
int64 startTime = 9; //
int64 expiredTime = 10; //
string month = 11; //
int32 bought = 12; //
int64 bundleType = 11;//
string month = 12; //
int32 bought = 13; //
//
int32 bundleAccountNumber = 13; //
int32 increaseAccountNumber = 14; //
int32 bundleAccountConsumptionNumber = 15; //
int32 increaseAccountConsumptionNumber = 16; //
int32 bundleAccountNumber = 14; //
int32 increaseAccountNumber = 15; //
int32 bundleAccountConsumptionNumber = 16; //
int32 increaseAccountConsumptionNumber = 17; //
//
int32 bundleVideoNumber = 17; //
int32 increaseVideoNumber = 18; //
int32 bundleVideoConsumptionNumber = 19; //
int32 increaseVideoConsumptionNumber = 20; //
int32 invalidBundleVideoNumber = 21; //
int32 invalidIncreaseVideoNumber = 22; //
int32 monthlyNewBundleVideoNumber = 23; //
int32 monthlyNewIncreaseVideoNumber = 24; //
int32 monthlyBundleVideoNumber = 25; //
int32 monthlyIncreaseVideoNumber = 26; //
int32 monthBundleVideoConsumptionNumber = 27; // 使
int32 monthIncreaseVideoConsumptionNumber = 28; // 使
int32 monthlyInvalidBundleVideoNumber = 29; //
int32 monthlyInvalidIncreaseVideoNumber = 30; //
int32 bundleVideoNumber = 18; //
int32 increaseVideoNumber = 19; //
int32 bundleVideoConsumptionNumber = 20; //
int32 increaseVideoConsumptionNumber = 21; //
int32 invalidBundleVideoNumber = 22; //
int32 invalidIncreaseVideoNumber = 23; //
int32 monthlyNewBundleVideoNumber = 24; //
int32 monthlyNewIncreaseVideoNumber = 25; //
int32 monthlyBundleVideoNumber = 26; //
int32 monthlyIncreaseVideoNumber = 27; //
int32 monthBundleVideoConsumptionNumber = 28; // 使
int32 monthIncreaseVideoConsumptionNumber = 29; // 使
int32 monthlyInvalidBundleVideoNumber = 30; //
int32 monthlyInvalidIncreaseVideoNumber = 31; //
//
int32 bundleImageNumber = 31; //
int32 increaseImageNumber = 32; //
int32 bundleImageConsumptionNumber = 33; //
int32 increaseImageConsumptionNumber = 34; //
int32 invalidBundleImageNumber = 35; //
int32 invalidIncreaseImageNumber = 36; //
int32 monthlyNewBundleImageNumber = 37; //
int32 monthlyNewIncreaseImageNumber = 38; //
int32 monthlyBundleImageNumber = 39; //
int32 monthlyIncreaseImageNumber = 40; //
int32 monthBundleImageConsumptionNumber = 41; // 使
int32 monthIncreaseImageConsumptionNumber = 42; // 使
int32 monthlyInvalidBundleImageNumber = 43; //
int32 monthlyInvalidIncreaseImageNumber = 44; //
int32 bundleImageNumber = 32; //
int32 increaseImageNumber = 33; //
int32 bundleImageConsumptionNumber = 34; //
int32 increaseImageConsumptionNumber = 35; //
int32 invalidBundleImageNumber = 36; //
int32 invalidIncreaseImageNumber = 37; //
int32 monthlyNewBundleImageNumber = 38; //
int32 monthlyNewIncreaseImageNumber = 39; //
int32 monthlyBundleImageNumber = 40; //
int32 monthlyIncreaseImageNumber = 41; //
int32 monthBundleImageConsumptionNumber = 42; // 使
int32 monthIncreaseImageConsumptionNumber = 43; // 使
int32 monthlyInvalidBundleImageNumber = 44; //
int32 monthlyInvalidIncreaseImageNumber = 45; //
//
int32 bundleDataAnalysisNumber = 45; //
int32 increaseDataAnalysisNumber = 46; //
int32 bundleDataAnalysisConsumptionNumber = 47; //
int32 increaseDataAnalysisConsumptionNumber = 48; //
int32 invalidBundleDataAnalysisNumber = 49; //
int32 invalidIncreaseDataAnalysisNumber = 50; //
int32 monthlyNewBundleDataAnalysisNumber = 51; //
int32 monthlyNewIncreaseDataAnalysisNumber = 52; //
int32 monthlyBundleDataAnalysisNumber = 53; //
int32 monthlyIncreaseDataAnalysisNumber = 54; //
int32 monthBundleDataAnalysisConsumptionNumber = 55; // 使
int32 monthIncreaseDataAnalysisConsumptionNumber = 56; // 使
int32 monthlyInvalidBundleDataAnalysisNumber = 57; //
int32 monthlyInvalidIncreaseDataAnalysisNumber = 58; //
int32 bundleDataAnalysisNumber = 46; //
int32 increaseDataAnalysisNumber = 47; //
int32 bundleDataAnalysisConsumptionNumber = 48; //
int32 increaseDataAnalysisConsumptionNumber = 49; //
int32 invalidBundleDataAnalysisNumber = 50; //
int32 invalidIncreaseDataAnalysisNumber = 51; //
int32 monthlyNewBundleDataAnalysisNumber = 52; //
int32 monthlyNewIncreaseDataAnalysisNumber = 53; //
int32 monthlyBundleDataAnalysisNumber = 54; //
int32 monthlyIncreaseDataAnalysisNumber = 55; //
int32 monthBundleDataAnalysisConsumptionNumber = 56; // 使
int32 monthIncreaseDataAnalysisConsumptionNumber = 57; // 使
int32 monthlyInvalidBundleDataAnalysisNumber = 58; //
int32 monthlyInvalidIncreaseDataAnalysisNumber = 59; //
//
int32 bundleCompetitiveNumber = 59; //
int32 increaseCompetitiveNumber = 60; //
int32 bundleCompetitiveConsumptionNumber = 61; //
int32 increaseCompetitiveConsumptionNumber = 62; //
int32 invalidBundleCompetitiveNumber = 63; //
int32 invalidIncreaseCompetitiveNumber = 64; //
int32 monthlyNewBundleCompetitiveNumber = 65; //
int32 monthlyNewIncreaseCompetitiveNumber = 66; //
int32 monthlyBundleCompetitiveNumber = 67; //
int32 monthlyIncreaseCompetitiveNumber = 68; //
int32 monthBundleCompetitiveConsumptionNumber = 69; // 使
int32 monthIncreaseCompetitiveConsumptionNumber = 70; // 使
int32 monthlyInvalidBundleCompetitiveNumber = 71; //
int32 monthlyInvalidIncreaseCompetitiveNumber = 72; //
int32 bundleCompetitiveNumber = 60; //
int32 increaseCompetitiveNumber = 61; //
int32 bundleCompetitiveConsumptionNumber = 62; //
int32 increaseCompetitiveConsumptionNumber = 63; //
int32 invalidBundleCompetitiveNumber = 64; //
int32 invalidIncreaseCompetitiveNumber = 65; //
int32 monthlyNewBundleCompetitiveNumber = 66; //
int32 monthlyNewIncreaseCompetitiveNumber = 67; //
int32 monthlyBundleCompetitiveNumber = 68; //
int32 monthlyIncreaseCompetitiveNumber = 69; //
int32 monthBundleCompetitiveConsumptionNumber = 70; // 使
int32 monthIncreaseCompetitiveConsumptionNumber = 71; // 使
int32 monthlyInvalidBundleCompetitiveNumber = 72; //
int32 monthlyInvalidIncreaseCompetitiveNumber = 73; //
//
int32 monthlyNewManualAccountNumber = 73; //
int32 monthlyNewManualVideoNumber = 74; //
int32 monthlyNewManualImageNumber = 75; //
int32 monthlyNewManualDataAnalysisNumber = 76; //
int32 monthlyNewManualCompetitiveNumber = 77; //
int32 monthlyNewDurationNumber = 78; // ()
int32 monthlyManualAccountConsumptionNumber = 79; //
int32 monthlyManualVideoConsumptionNumber = 80; //
int32 monthlyManualImageConsumptionNumber = 81; //
int32 monthlyManualDataAnalysisConsumptionNumber = 82; //
int32 monthlyManualCompetitiveConsumptionNumber = 83; //
int32 manualAccountConsumptionNumber = 84; //
int32 manualVideoConsumptionNumber = 85; //
int32 manualImageConsumptionNumber = 86; //
int32 manualDataAnalysisConsumptionNumber = 87; //
int32 manualCompetitiveConsumptionNumber = 88; //
int32 manualAccountNumber = 89; //
int32 manualVideoNumber = 90; //
int32 manualImageNumber = 91; //
int32 manualDataAnalysisNumber = 92; //
int32 manualCompetitiveNumber = 93; //
int32 monthlyNewManualAccountNumber = 74; //
int32 monthlyNewManualVideoNumber = 75; //
int32 monthlyNewManualImageNumber = 76; //
int32 monthlyNewManualDataAnalysisNumber = 77; //
int32 monthlyNewManualCompetitiveNumber = 78; //
int32 monthlyNewDurationNumber = 79; // ()
int32 monthlyManualAccountConsumptionNumber = 80; //
int32 monthlyManualVideoConsumptionNumber = 81; //
int32 monthlyManualImageConsumptionNumber = 82; //
int32 monthlyManualDataAnalysisConsumptionNumber = 83; //
int32 monthlyManualCompetitiveConsumptionNumber = 84; //
int32 manualAccountConsumptionNumber = 85; //
int32 manualVideoConsumptionNumber = 86; //
int32 manualImageConsumptionNumber = 87; //
int32 manualDataAnalysisConsumptionNumber = 88; //
int32 manualCompetitiveConsumptionNumber = 89; //
int32 manualAccountNumber = 90; //
int32 manualVideoNumber = 91; //
int32 manualImageNumber = 92; //
int32 manualDataAnalysisNumber = 93; //
int32 manualCompetitiveNumber = 94; //
}
@ -1027,6 +1079,7 @@ message BundleBalanceExportReq{
uint64 expiredTimeStart = 3;
uint64 expiredTimeEnd = 4;
uint32 status = 5;
uint32 bundleType = 6;
}
message BundleBalanceExportResp{
@ -1034,12 +1087,18 @@ message BundleBalanceExportResp{
repeated BundleBalanceExportItem data =2;
}
message PayLaterBundleBalanceExportResp{
int64 total = 1;
repeated PayLaterBundleBalanceItem data =2;
}
message GetBundleBalanceListResp{
int64 total = 1;
repeated BundleBalanceItem data = 2;
}
message CreateBundleBalanceReq{
int32 userId = 1;
string orderUUID = 2;
@ -1091,6 +1150,7 @@ message GetUsedRecordListReq{
int32 page = 9;
int32 pageSize = 10;
int32 costType = 11;
int32 bundleType = 12;
}
message GetUsedRecordListResp {
@ -1171,6 +1231,7 @@ message ToBeComfirmedWorksResp{
message GetBundleBalanceByUserIdReq{
int32 userId = 1;
string orderUUID = 2;
}
message GetBundleBalanceByUserIdResp{
@ -1212,6 +1273,20 @@ message GetBundleBalanceByUserIdResp{
string renewalOrderUuid = 36;
}
message GetBundleOrderListByUserIdReq{
int32 userId = 1;
}
message BalanceOrderItem{
string orderUuid = 1;
int64 purchaseType = 2;
int64 bundleType = 3;
}
message GetBundleOrderListByUserIdResp{
repeated BalanceOrderItem orderItem = 1;
}
message GetBundleBalanceByOrderUUIDReq{
string orderUUID = 1;
}
@ -1705,6 +1780,7 @@ message ArtistBundleBalanceResponse {
message SetBundleBalanceLayoutReq{
uint32 userId = 1;
string data = 2;
int32 bundleType = 3; // 1: 2:
}
message SetBundleBalanceLayoutResp{
@ -1713,6 +1789,7 @@ message SetBundleBalanceLayoutResp{
message GetBundleBalanceLayoutReq{
uint32 userId = 1;
int32 bundleType = 2;
}
message GetBundleBalanceLayoutResp{

File diff suppressed because it is too large Load Diff

View File

@ -399,6 +399,22 @@ func (this *BundleExtendRecordItem) Validate() error {
func (this *GetBundleBalanceListReq) Validate() error {
return nil
}
func (this *GetPayLaterBundleBalanceListReq) Validate() error {
return nil
}
func (this *PayLaterBundleBalanceItem) Validate() error {
return nil
}
func (this *GetPayLaterBundleBalanceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *GetBundleBalanceReq) Validate() error {
return nil
}
@ -421,6 +437,16 @@ func (this *BundleBalanceExportResp) Validate() error {
}
return nil
}
func (this *PayLaterBundleBalanceExportResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *GetBundleBalanceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
@ -493,6 +519,22 @@ func (this *GetBundleBalanceByUserIdReq) Validate() error {
func (this *GetBundleBalanceByUserIdResp) Validate() error {
return nil
}
func (this *GetBundleOrderListByUserIdReq) Validate() error {
return nil
}
func (this *BalanceOrderItem) Validate() error {
return nil
}
func (this *GetBundleOrderListByUserIdResp) Validate() error {
for _, item := range this.OrderItem {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderItem", err)
}
}
}
return nil
}
func (this *GetBundleBalanceByOrderUUIDReq) Validate() error {
return nil
}

View File

@ -69,12 +69,15 @@ type BundleClient interface {
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment)
BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment)
GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment)
GetPayLaterBundleBalanceList(ctx context.Context, in *GetPayLaterBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetPayLaterBundleBalanceListResp, common.ErrorWithAttachment)
GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment)
GetBundleOrderListByUserId(ctx context.Context, in *GetBundleOrderListByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleOrderListByUserIdResp, common.ErrorWithAttachment)
GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment)
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
BundleActivate(ctx context.Context, in *BundleActivateReq, opts ...grpc_go.CallOption) (*BundleActivateResp, common.ErrorWithAttachment)
BundleBalanceExport(ctx context.Context, in *BundleBalanceExportReq, opts ...grpc_go.CallOption) (*BundleBalanceExportResp, common.ErrorWithAttachment)
PayLaterBundleBalanceExport(ctx context.Context, in *BundleBalanceExportReq, opts ...grpc_go.CallOption) (*PayLaterBundleBalanceExportResp, common.ErrorWithAttachment)
GetBundleBalanceLayout(ctx context.Context, in *GetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*GetBundleBalanceLayoutResp, common.ErrorWithAttachment)
SetBundleBalanceLayout(ctx context.Context, in *SetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*SetBundleBalanceLayoutResp, common.ErrorWithAttachment)
// 使用记录
@ -198,12 +201,15 @@ type BundleClientImpl struct {
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
GetPayLaterBundleBalanceList func(ctx context.Context, in *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error)
GetBundleBalanceByUserId func(ctx context.Context, in *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
GetBundleOrderListByUserId func(ctx context.Context, in *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
GetBundleBalanceByOrderUUID func(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
BundleActivate func(ctx context.Context, in *BundleActivateReq) (*BundleActivateResp, error)
BundleBalanceExport func(ctx context.Context, in *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
PayLaterBundleBalanceExport func(ctx context.Context, in *BundleBalanceExportReq) (*PayLaterBundleBalanceExportResp, error)
GetBundleBalanceLayout func(ctx context.Context, in *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
SetBundleBalanceLayout func(ctx context.Context, in *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
@ -514,12 +520,24 @@ func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBa
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out)
}
func (c *bundleClient) GetPayLaterBundleBalanceList(ctx context.Context, in *GetPayLaterBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetPayLaterBundleBalanceListResp, common.ErrorWithAttachment) {
out := new(GetPayLaterBundleBalanceListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPayLaterBundleBalanceList", in, out)
}
func (c *bundleClient) GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceByUserIdResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceByUserId", in, out)
}
func (c *bundleClient) GetBundleOrderListByUserId(ctx context.Context, in *GetBundleOrderListByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleOrderListByUserIdResp, common.ErrorWithAttachment) {
out := new(GetBundleOrderListByUserIdResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleOrderListByUserId", in, out)
}
func (c *bundleClient) GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceByOrderUUIDResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -550,6 +568,12 @@ func (c *bundleClient) BundleBalanceExport(ctx context.Context, in *BundleBalanc
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleBalanceExport", in, out)
}
func (c *bundleClient) PayLaterBundleBalanceExport(ctx context.Context, in *BundleBalanceExportReq, opts ...grpc_go.CallOption) (*PayLaterBundleBalanceExportResp, common.ErrorWithAttachment) {
out := new(PayLaterBundleBalanceExportResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PayLaterBundleBalanceExport", in, out)
}
func (c *bundleClient) GetBundleBalanceLayout(ctx context.Context, in *GetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*GetBundleBalanceLayoutResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceLayoutResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -1003,12 +1027,15 @@ type BundleServer interface {
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
GetPayLaterBundleBalanceList(context.Context, *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error)
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
BundleActivate(context.Context, *BundleActivateReq) (*BundleActivateResp, error)
BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
PayLaterBundleBalanceExport(context.Context, *BundleBalanceExportReq) (*PayLaterBundleBalanceExportResp, error)
GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
SetBundleBalanceLayout(context.Context, *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
// 使用记录
@ -1209,9 +1236,15 @@ func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *Bundl
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
}
func (UnimplementedBundleServer) GetPayLaterBundleBalanceList(context.Context, *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPayLaterBundleBalanceList not implemented")
}
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
}
func (UnimplementedBundleServer) GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleOrderListByUserId not implemented")
}
func (UnimplementedBundleServer) GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByOrderUUID not implemented")
}
@ -1227,6 +1260,9 @@ func (UnimplementedBundleServer) BundleActivate(context.Context, *BundleActivate
func (UnimplementedBundleServer) BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleBalanceExport not implemented")
}
func (UnimplementedBundleServer) PayLaterBundleBalanceExport(context.Context, *BundleBalanceExportReq) (*PayLaterBundleBalanceExportResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PayLaterBundleBalanceExport not implemented")
}
func (UnimplementedBundleServer) GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceLayout not implemented")
}
@ -2561,6 +2597,35 @@ func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetPayLaterBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPayLaterBundleBalanceListReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetPayLaterBundleBalanceList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceByUserIdReq)
if err := dec(in); err != nil {
@ -2590,6 +2655,35 @@ func _Bundle_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleOrderListByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleOrderListByUserIdReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetBundleOrderListByUserId", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleBalanceByOrderUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceByOrderUUIDReq)
if err := dec(in); err != nil {
@ -2735,6 +2829,35 @@ func _Bundle_BundleBalanceExport_Handler(srv interface{}, ctx context.Context, d
return interceptor(ctx, in, info, handler)
}
func _Bundle_PayLaterBundleBalanceExport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleBalanceExportReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("PayLaterBundleBalanceExport", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleBalanceLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceLayoutReq)
if err := dec(in); err != nil {
@ -4866,10 +4989,18 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "GetBundleBalanceList",
Handler: _Bundle_GetBundleBalanceList_Handler,
},
{
MethodName: "GetPayLaterBundleBalanceList",
Handler: _Bundle_GetPayLaterBundleBalanceList_Handler,
},
{
MethodName: "GetBundleBalanceByUserId",
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
},
{
MethodName: "GetBundleOrderListByUserId",
Handler: _Bundle_GetBundleOrderListByUserId_Handler,
},
{
MethodName: "GetBundleBalanceByOrderUUID",
Handler: _Bundle_GetBundleBalanceByOrderUUID_Handler,
@ -4890,6 +5021,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "BundleBalanceExport",
Handler: _Bundle_BundleBalanceExport_Handler,
},
{
MethodName: "PayLaterBundleBalanceExport",
Handler: _Bundle_PayLaterBundleBalanceExport_Handler,
},
{
MethodName: "GetBundleBalanceLayout",
Handler: _Bundle_GetBundleBalanceLayout_Handler,

View File

@ -119,6 +119,7 @@ const (
DataReportService = 3 //数据报表
AccountService = 4 //账号数
AvailableTimeService = 5 //可用时长
CompetitiveService = 6 //竞品数
)
// 套餐状态