Compare commits
33 Commits
main
...
feat-hjj-P
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3f713faa7 | ||
|
|
0d41e1a0c5 | ||
|
|
72427f8268 | ||
|
|
24b6506be8 | ||
|
|
669e5377bb | ||
|
|
48e0bdd93d | ||
|
|
7a870a641b | ||
|
|
cd4c003bcd | ||
|
|
8e52bba692 | ||
|
|
8efae21524 | ||
|
|
4b7c56d1b6 | ||
|
|
ae3d62ff24 | ||
|
|
bb30a04163 | ||
|
|
45385724d1 | ||
|
|
3ea4a9f1d8 | ||
|
|
4f3d256091 | ||
|
|
a10e13c642 | ||
|
|
debafff038 | ||
|
|
f6127e87a3 | ||
|
|
132232d183 | ||
|
|
375998a746 | ||
|
|
6a313329e8 | ||
|
|
46cea10a5e | ||
|
|
307905849b | ||
|
|
17c8114b47 | ||
|
|
f9c7edf7c3 | ||
|
|
20f94743d4 | ||
|
|
d668424ac7 | ||
|
|
f2eb757c67 | ||
|
|
acdd67e0ae | ||
|
|
2fd6a2429c | ||
|
|
7df0804b3d | ||
|
|
ffbb174857 |
@ -22,11 +22,21 @@ func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.Get
|
|||||||
return logic.GetBundleBalanceList(req)
|
return logic.GetBundleBalanceList(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 先用后付套餐余量信息列表
|
||||||
|
func (b *BundleProvider) GetPayLaterBundleBalanceList(_ context.Context, req *bundle.GetPayLaterBundleBalanceListReq) (*bundle.GetPayLaterBundleBalanceListResp, error) {
|
||||||
|
return logic.GetPayLaterBundleBalanceList(req)
|
||||||
|
}
|
||||||
|
|
||||||
// 根据用户ID查询套餐余额
|
// 根据用户ID查询套餐余额
|
||||||
func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
||||||
return logic.GetBundleBalanceByUserId(req)
|
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) {
|
func (b *BundleProvider) GetBundleBalanceByOrderUUID(_ context.Context, req *bundle.GetBundleBalanceByOrderUUIDReq) (*bundle.GetBundleBalanceByOrderUUIDResp, error) {
|
||||||
startTime, status, err := logic.GetBundleBalanceByOrderUUID(req.OrderUUID)
|
startTime, status, err := logic.GetBundleBalanceByOrderUUID(req.OrderUUID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -83,11 +93,16 @@ func (b *BundleProvider) BundleActivate(_ context.Context, req *bundle.BundleAct
|
|||||||
return nil, logic.BundleActivate(req)
|
return nil, logic.BundleActivate(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 套餐余额导出
|
// 普通套餐余额导出
|
||||||
func (b *BundleProvider) BundleBalanceExport(_ context.Context, req *bundle.BundleBalanceExportReq) (*bundle.BundleBalanceExportResp, error) {
|
func (b *BundleProvider) BundleBalanceExport(_ context.Context, req *bundle.BundleBalanceExportReq) (*bundle.BundleBalanceExportResp, error) {
|
||||||
return logic.BundleBalanceExport(req)
|
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) {
|
func (b *BundleProvider) GetBundleBalanceLayout(_ context.Context, req *bundle.GetBundleBalanceLayoutReq) (*bundle.GetBundleBalanceLayoutResp, error) {
|
||||||
return logic.GetBundleBalanceLayout(req)
|
return logic.GetBundleBalanceLayout(req)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 测试注释
|
||||||
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
|
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
|
||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.CommonResponse)
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? and language= ?", req.UUID, req.Language).Updates(req).Error
|
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)
|
query = query.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
query = query.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
count := *query
|
count := *query
|
||||||
|
|
||||||
if req.PageSize != 0 && req.Page != 0 {
|
if req.PageSize != 0 && req.Page != 0 {
|
||||||
@ -88,6 +93,8 @@ func BundleList(req *bundle.BundleListRequest) (res *bundle.BundleListResponse,
|
|||||||
CompanySign: bundleProfile.CompanySign,
|
CompanySign: bundleProfile.CompanySign,
|
||||||
ContractDuration: int64(bundleProfile.ContractDuration),
|
ContractDuration: int64(bundleProfile.ContractDuration),
|
||||||
BundleCommonUid: bundleProfile.BundleCommonUid,
|
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,
|
CompanySign: bundleProfile.CompanySign,
|
||||||
ContractDuration: int64(bundleProfile.ContractDuration),
|
ContractDuration: int64(bundleProfile.ContractDuration),
|
||||||
BundleCommonUid: bundleProfile.BundleCommonUid,
|
BundleCommonUid: bundleProfile.BundleCommonUid,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -150,6 +159,10 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
baseQuery = baseQuery.Where("language like ?", req.Language)
|
baseQuery = baseQuery.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
baseQuery = baseQuery.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
var total int64
|
var total int64
|
||||||
if err = baseQuery.Count(&total).Error; err != nil {
|
if err = baseQuery.Count(&total).Error; err != nil {
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐总数失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐总数失败: ")
|
||||||
@ -224,6 +237,8 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
BundleProfileLang: bundleProfileLang,
|
BundleProfileLang: bundleProfileLang,
|
||||||
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
||||||
FontColor: bundleProfile.FontColor,
|
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)
|
res.Bundles = make([]*bundle.BundleProfile, 0)
|
||||||
bundles := make([]*model.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) //上架的
|
//query = query.Where("shelf_status = ?", 1) //上架的
|
||||||
|
|
||||||
if req.Name != "" {
|
if req.Name != "" {
|
||||||
@ -393,6 +408,10 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
query = query.Where("language like ?", req.Language)
|
query = query.Where("language like ?", req.Language)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.BundleType != 0 {
|
||||||
|
query = query.Where("bundle_type = ?", req.BundleType)
|
||||||
|
}
|
||||||
|
|
||||||
count := *query
|
count := *query
|
||||||
|
|
||||||
// 排序:sort 升序,相同 sort 按 created_at 倒序
|
// 排序:sort 升序,相同 sort 按 created_at 倒序
|
||||||
@ -451,6 +470,8 @@ func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListRespon
|
|||||||
BundleProfileLang: bundleProfileLang,
|
BundleProfileLang: bundleProfileLang,
|
||||||
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
||||||
FontColor: bundleProfile.FontColor,
|
FontColor: bundleProfile.FontColor,
|
||||||
|
BundleType: int64(bundleProfile.BundleType),
|
||||||
|
PayLaterTime: int64(bundleProfile.PayLaterTime),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,6 +73,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
|||||||
Joins(`INNER JOIN (
|
Joins(`INNER JOIN (
|
||||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||||
FROM bundle_order_records
|
FROM bundle_order_records
|
||||||
|
WHERE order_type = 1 AND deleted_at is NULL
|
||||||
GROUP BY customer_id
|
GROUP BY customer_id
|
||||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
) 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().
|
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("rn.name IS NOT NULL").
|
||||||
Where("u.deleted_at = 0").
|
Where("u.deleted_at = 0").
|
||||||
Where("bor.deleted_at IS NULL").
|
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")
|
Order("bor.expiration_time desc")
|
||||||
if req.UserName != "" {
|
if req.UserName != "" {
|
||||||
if utils.IsPhoneNumber(req.UserName) {
|
if utils.IsPhoneNumber(req.UserName) {
|
||||||
@ -152,15 +154,110 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
|
// 查询先用后付套餐余量列表 (bundle_type = 2)
|
||||||
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
// 每个艺人一行:视频字段对该艺人所有未过期且 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.*").
|
Select("bor1.*").
|
||||||
Joins(`INNER JOIN (
|
Joins(`INNER JOIN (
|
||||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||||
FROM bundle_order_records
|
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
|
GROUP BY customer_id
|
||||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
) 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().
|
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,
|
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,
|
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.deleted_at = 0").
|
||||||
Where("u.id = ?", req.UserId).
|
Where("u.id = ?", req.UserId).
|
||||||
Where("bb.month = ?", time.Now().Format("2006-01")).
|
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
|
err = session.First(&data).Error
|
||||||
return
|
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) {
|
func GetBundleBalanceByOrderUuid(orderUuid string) (data model.BundleBalance, err error) {
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Where("order_uuid = ?", orderUuid).First(&data).Error
|
err = app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Where("order_uuid = ?", orderUuid).First(&data).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -193,7 +307,7 @@ func AddBundleBalanceByUserId(data model.BundleBalanceUsePo) (usedType int, err
|
|||||||
return errors.New("套餐未激活")
|
return errors.New("套餐未激活")
|
||||||
}
|
}
|
||||||
oldData := model.BundleBalance{}
|
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("用户还没有套餐信息")
|
return errors.New("用户还没有套餐信息")
|
||||||
}
|
}
|
||||||
if data.AccountNumber > 0 { // 增加账号消耗数
|
if data.AccountNumber > 0 { // 增加账号消耗数
|
||||||
@ -478,7 +592,9 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLogPo, to
|
|||||||
Table("cast_cost_log ccl").
|
Table("cast_cost_log ccl").
|
||||||
Select("ccl.*,cwe.cost_type").
|
Select("ccl.*,cwe.cost_type").
|
||||||
Joins("left join cast_work_extra cwe on cwe.work_uuid = ccl.work_uuid").
|
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 != "" {
|
if req.WorkTitle != "" {
|
||||||
session = session.Where("ccl.work_title like ?", "%"+req.WorkTitle+"%")
|
session = session.Where("ccl.work_title like ?", "%"+req.WorkTitle+"%")
|
||||||
}
|
}
|
||||||
@ -930,7 +1046,7 @@ left join (
|
|||||||
|
|
||||||
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, error) {
|
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, error) {
|
||||||
data := &model.BundleBalanceLayout{}
|
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 "nil", err
|
||||||
}
|
}
|
||||||
return data.Data, nil
|
return data.Data, nil
|
||||||
@ -938,7 +1054,7 @@ func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (string, erro
|
|||||||
|
|
||||||
func SetBundleBalanceLayout(req *bundle.SetBundleBalanceLayoutReq) error {
|
func SetBundleBalanceLayout(req *bundle.SetBundleBalanceLayoutReq) error {
|
||||||
return app.ModuleClients.BundleDB.Clauses(clause.OnConflict{
|
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"}),
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
subQuery := app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
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").
|
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").
|
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 != "" {
|
// if req.BundleUuid != "" {
|
||||||
// subQuery = subQuery.Where("bor.bundle_uuid = ?", 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,
|
TRUNCATE(COALESCE(SUM(total_amount), 0) - COALESCE(SUM(amount), 0), 3) as total_increase_payment_amount,
|
||||||
(?) as total_fee_payment_amount
|
(?) as total_fee_payment_amount
|
||||||
`, subQuery).
|
`, subQuery).
|
||||||
Where("deleted_at IS NULL and status=2")
|
Where("deleted_at IS NULL and status=2 and order_type = 1")
|
||||||
// if req.BundleUuid != "" {
|
// if req.BundleUuid != "" {
|
||||||
// query = query.Where("bundle_uuid = ?", 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").
|
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.Start+" 00:00:00").
|
||||||
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
subQuery = subQuery.Where("bor.bundle_uuid = ?", 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.Start+" 00:00:00").
|
||||||
Where("`bundle_order_records`.pay_time <= ?", req.End+" 23:59:59").
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
query = query.Where("bundle_uuid = ?", 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{}).
|
countQuery := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
||||||
Where("pay_time >= ?", req.Start+" 00:00:00").
|
Where("pay_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("pay_time <= ?", req.End+" 23:59:59").
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
countQuery = countQuery.Where("bundle_uuid = ?", 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").
|
subQuery = app.ModuleClients.BundleDB.Table("bundle_order_records AS bor2").
|
||||||
Select("1").
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
subQuery = subQuery.Where("bundle_uuid = ?", 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("EXISTS (?)", subQuery).
|
||||||
Where("bor.pay_time >= ?", req.Start+" 00:00:00").
|
Where("bor.pay_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("bor.pay_time <= ?", req.End+" 23:59:59").
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
repoQuery = repoQuery.Where("bor.bundle_uuid = ?", 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
|
var newIncreaseCount int64
|
||||||
incQuery := app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
incQuery := app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
|
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.Start+" 00:00:00").
|
||||||
Where("`bundle_order_value_add`.created_at <= ?", req.End+" 23:59:59").
|
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")
|
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").
|
subQuery = app.ModuleClients.BundleDB.Table("bundle_order_value_add AS bova2").
|
||||||
Select("1").
|
Select("1").
|
||||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
|
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")
|
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 != "" {
|
if req.BundleUuid != "" {
|
||||||
subQuery = subQuery.Where("bundle_uuid = ?", 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").
|
repoQuery = app.ModuleClients.BundleDB.Table("bundle_order_value_add AS bova").
|
||||||
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
|
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = order_uuid").
|
||||||
|
Where("bor.order_type = 1").
|
||||||
Where("EXISTS (?)", subQuery).
|
Where("EXISTS (?)", subQuery).
|
||||||
Where("bova.created_at >= ?", req.Start+" 00:00:00").
|
Where("bova.created_at >= ?", req.Start+" 00:00:00").
|
||||||
Where("bova.created_at <= ?", req.End+" 23:59:59").
|
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_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("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").
|
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("cast_work.work_category = 2").
|
||||||
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
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_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("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").
|
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("cast_work.work_category = 2").
|
||||||
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
Where("cwl.update_time >= ?", req.Start+" 00:00:00").
|
||||||
Where("cwl.update_time <= ?", req.End+" 23:59:59").
|
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_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").
|
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("cwe.cost_type in ?", []int{1, 2}).
|
||||||
Where("cw.work_category = ?", 2).
|
Where("cw.work_category = ?", 2).
|
||||||
Where("cw.status in ?", []int{7, 6, 9}).
|
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 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).
|
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("nb.new_month = bb.month").
|
||||||
|
Where("bor.order_type = 1").
|
||||||
Where("bb.deleted_at is null").
|
Where("bb.deleted_at is null").
|
||||||
Where("bor.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
|
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").
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
@ -336,7 +341,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
query = 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").
|
||||||
Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.origin_uuid = ''").
|
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_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").
|
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.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 2"). // 视频类型
|
Where("cast_work.work_category = 2"). // 视频类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1 and cwe.billing_type = 0"). // 套餐类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
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_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").
|
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.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 2"). // 视频类型
|
Where("cast_work.work_category = 2 and cwe.billing_type = 0"). // 视频类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
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 ").
|
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.Start+" 00:00:00").Unix()).
|
||||||
Where("cma.created_at <= ?", timeParse(req.End+" 23:59:59").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")
|
Group("cma.user_id")
|
||||||
|
|
||||||
if req.BundleUuid != "" {
|
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").
|
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 ").
|
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.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 != "" {
|
if req.BundleUuid != "" {
|
||||||
query = query.Where("bor.bundle_uuid = ?", 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
|
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").
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
@ -475,7 +481,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
query = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
query = 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 ").
|
||||||
Joins("left join bundle_order_records bor ON bor.uuid COLLATE utf8mb4_general_ci = cwe.bundle_order_uuid COLLATE utf8mb4_general_ci").
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.origin_uuid = ''").
|
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_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").
|
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.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 1"). // 图文类型
|
Where("cast_work.work_category = 1 and cwe.billing_type = 0"). // 图文类型
|
||||||
Where("cwe.cost_type = 1 "). // 套餐类型
|
Where("cwe.cost_type = 1 "). // 套餐类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
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_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").
|
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.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("cast_work.work_category = 1"). // 图文类型
|
Where("cast_work.work_category = 1 and cwe.billing_type = 0"). // 图文类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0")
|
Where("cast_work.deleted_at = 0")
|
||||||
@ -742,10 +748,10 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
//====================视频=======================
|
//====================视频=======================
|
||||||
var newUploadedBundleVideoCount int64
|
var newUploadedBundleVideoCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
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("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
@ -764,9 +770,9 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
|
|
||||||
var totalUploadedVideoCount int64
|
var totalUploadedVideoCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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("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("cast_work.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
@ -777,8 +783,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
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{}).
|
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").
|
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("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 2"). // 视频类型
|
Where("work_category = 2 and cwe.billing_type = 0"). // 视频类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型或扩展类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
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
|
var newUploadedBundleImageCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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.Start+" 00:00:00").
|
||||||
Where("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
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.origin_uuid = ''").
|
||||||
// Where("cwe.cost_type = 1"). // 套餐类型
|
// Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("deleted_at = 0").
|
Where("deleted_at = 0").
|
||||||
@ -836,9 +842,9 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
|
|
||||||
var totalUploadedImageCount int64
|
var totalUploadedImageCount int64
|
||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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("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.origin_uuid = ''").
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
// Where("cwe.cost_type = 2"). // 套餐类型
|
// Where("cwe.cost_type = 2"). // 套餐类型
|
||||||
@ -850,8 +856,8 @@ func MetricsOperatingCreate(req *bundle.MetricsOperatingCreateReq) (result *bund
|
|||||||
app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
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("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
|
||||||
Where("cwe.cost_type = 1"). // 套餐类型
|
Where("cwe.cost_type = 1"). // 套餐类型
|
||||||
Where("cast_work.status != 8").
|
Where("cast_work.status != 8").
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
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{}).
|
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").
|
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("cast_work.submit_time <= ?", req.End+" 23:59:59").
|
||||||
Where("work_category = 1"). // 图文类型
|
Where("work_category = 1 and cwe.billing_type = 0"). // 图文类型
|
||||||
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
Where("cwe.cost_type in ?", []int{2, 3}). // 增值类型
|
||||||
Where("cast_work.origin_uuid = ''").
|
Where("cast_work.origin_uuid = ''").
|
||||||
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
Where("cast_work.deleted_at = 0 and cwe.deleted_at = 0").
|
||||||
Count(&totalUploadedIncreaseImageCount)
|
Count(&totalUploadedIncreaseImageCount)
|
||||||
@ -996,7 +1002,9 @@ func manualIncreaseBundleBalance(startTime string, endTime string, bundleUUID st
|
|||||||
// 通过 order_uuid 联表 bundle_order_records 获取 bundle_uuid
|
// 通过 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").
|
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 过滤
|
// 支持 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 {
|
if err = quary.Scan(&data).Error; err != nil {
|
||||||
return
|
return
|
||||||
@ -1031,15 +1039,17 @@ func balanceInfoWithShop(startMonth string, endMonth string, startTime string, e
|
|||||||
bb.monthly_bundle_limit_expired_competitive_number
|
bb.monthly_bundle_limit_expired_competitive_number
|
||||||
) AS competitive
|
) 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 (
|
Joins(`INNER JOIN (
|
||||||
SELECT order_uuid, MIN(created_at) AS min_created_at
|
SELECT order_uuid, MIN(created_at) AS min_created_at
|
||||||
FROM bundle_balance
|
FROM bundle_balance
|
||||||
WHERE deleted_at IS NULL
|
WHERE deleted_at IS NULL
|
||||||
GROUP BY order_uuid
|
GROUP BY order_uuid
|
||||||
) AS bb_min ON bb.order_uuid = bb_min.order_uuid AND bb.created_at = bb_min.min_created_at`).
|
) 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("bb.month = DATE_FORMAT(bb.start_at, '%Y-%m')").
|
||||||
|
Where("bor.order_type = ?", model.BundleTypeBasic).
|
||||||
Where("bb.deleted_at IS NULL")
|
Where("bb.deleted_at IS NULL")
|
||||||
if bundleUUID != "" {
|
if bundleUUID != "" {
|
||||||
subQuery = subQuery.Where("bor.bundle_uuid = ?", 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
|
bb.monthly_increase_limit_expired_competitive_number
|
||||||
) AS competitive
|
) 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 (
|
Joins(`INNER JOIN (
|
||||||
SELECT order_uuid, MIN(created_at) AS min_created_at
|
SELECT order_uuid, MIN(created_at) AS min_created_at
|
||||||
FROM bundle_balance
|
FROM bundle_balance
|
||||||
WHERE deleted_at IS NULL
|
WHERE deleted_at IS NULL
|
||||||
GROUP BY order_uuid
|
GROUP BY order_uuid
|
||||||
) AS bb_min ON bb.order_uuid = bb_min.order_uuid AND bb.created_at = bb_min.min_created_at`).
|
) 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.month = DATE_FORMAT(bb.start_at, '%Y-%m')").
|
||||||
Where("bb.deleted_at IS NULL")
|
Where("bb.deleted_at IS NULL")
|
||||||
if bundleUUID != "" {
|
if bundleUUID != "" {
|
||||||
@ -1183,7 +1195,7 @@ func getBundleBalanceInfo(month string, bundleUUID string, endTime string) (data
|
|||||||
bb.monthly_bundle_limit_competitive_consumption_number
|
bb.monthly_bundle_limit_competitive_consumption_number
|
||||||
) AS competitive
|
) 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").
|
Where("bor.deleted_at is null and bor.status=2").
|
||||||
Joins(`INNER JOIN (
|
Joins(`INNER JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
@ -1269,7 +1281,7 @@ func getIncreaseBalanceInfo(month string, bundleUUID string, endTime string) (da
|
|||||||
bb.monthly_increase_limit_competitive_consumption_number
|
bb.monthly_increase_limit_competitive_consumption_number
|
||||||
) AS competitive
|
) 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 (
|
Joins(`INNER JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
bb_inner.user_id,
|
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) {
|
func MetricsOperatingStatus(req *bundle.MetricsOperatingStatusReq) (data *bundle.MetricsOperatingStatusResp, err error) {
|
||||||
data = &bundle.MetricsOperatingStatusResp{}
|
data = &bundle.MetricsOperatingStatusResp{}
|
||||||
var statistic = func(status int8, workCategory int8) (i int64) {
|
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
|
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").
|
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.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("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").
|
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
|
||||||
Count(&data.ArtistConfirmVideoCount)
|
Count(&data.ArtistConfirmVideoCount)
|
||||||
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
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("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.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("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
|
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{}).
|
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("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.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("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
|
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
|
||||||
Count(&data.ArtistConfirmImageCount)
|
Count(&data.ArtistConfirmImageCount)
|
||||||
app.ModuleClients.BundleDB.Model(model.CastWork{}).
|
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("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.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("cast_work.submit_time <= ?", req.Date+" 23:59:59").
|
||||||
Where("cwe.deleted_at = 0 and cast_work.deleted_at = 0").
|
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
|
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
|
group by a1.order_no
|
||||||
) t4 on t1.order_no = t4.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`,
|
order by t2.sub_num asc`,
|
||||||
"`micro-account`.`user`",
|
"`micro-account`.`user`",
|
||||||
"`micro-account`.`real_name`")
|
"`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_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 (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`).
|
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")
|
Where("bor.deleted_at is null")
|
||||||
err = query.Find(&data.Data).Error
|
err = query.Find(&data.Data).Error
|
||||||
if err != nil {
|
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 = 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 (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").
|
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 = ''").
|
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")
|
Order("cw.artist_name")
|
||||||
} else {
|
} 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`).
|
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(`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")
|
Order("cw.artist_name")
|
||||||
}
|
}
|
||||||
err = query.Find(&result.Data).Error
|
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").
|
query := app.ModuleClients.BundleDB.Table("bundle_balance as bb").
|
||||||
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").
|
||||||
Where("bb.`month` = ?", datetime.AddMonth(t, -1).Format("2006-01")).
|
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")
|
Where("bor.deleted_at is null and bb.deleted_at is null")
|
||||||
if bundleUuid != "" {
|
if bundleUuid != "" {
|
||||||
query = query.Where("bor.bundle_uuid = ?", 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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 临时接口,不在正逻辑中使用
|
||||||
func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCastInfoResp, error) {
|
func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCastInfoResp, error) {
|
||||||
result := &bundle.ExportWorkCastInfoResp{}
|
result := &bundle.ExportWorkCastInfoResp{}
|
||||||
query := app.ModuleClients.BundleDB.Raw(`
|
query := app.ModuleClients.BundleDB.Raw(`
|
||||||
@ -1788,6 +1812,7 @@ func ExportWorkCastInfo(req *bundle.ExportWorkCastInfoReq) (*bundle.ExportWorkCa
|
|||||||
WHERE bb.deleted_at IS NULL
|
WHERE bb.deleted_at IS NULL
|
||||||
AND bb.month = '2026-01'
|
AND bb.month = '2026-01'
|
||||||
AND bor.deleted_at IS NULL
|
AND bor.deleted_at IS NULL
|
||||||
|
AND bor.order_type = 1
|
||||||
AND cw.title IS NOT NULL
|
AND cw.title IS NOT NULL
|
||||||
AND cw.submit_time < ?
|
AND cw.submit_time < ?
|
||||||
AND cw.submit_time > ?
|
AND cw.submit_time > ?
|
||||||
|
|||||||
@ -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) {
|
func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res []*model.ValueAddService, total int64, err error) {
|
||||||
query := app.ModuleClients.BundleDB.Model(&model.ValueAddService{}).
|
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 {
|
if req.Name != "" || req.ServiceType != 0 {
|
||||||
subQuery := app.ModuleClients.BundleDB.Model(&model.ValueAddServiceLang{}).
|
subQuery := app.ModuleClients.BundleDB.Model(&model.ValueAddServiceLang{}).
|
||||||
Select("uuid").
|
Select("uuid").
|
||||||
|
|||||||
@ -96,6 +96,7 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
|
|||||||
PayTime: m.PayTime,
|
PayTime: m.PayTime,
|
||||||
StartTime: m.StartAt.UnixMilli(),
|
StartTime: m.StartAt.UnixMilli(),
|
||||||
Status: int32(m.Status),
|
Status: int32(m.Status),
|
||||||
|
BundleType: int64(m.BundleType),
|
||||||
BundleName: m.BundleName,
|
BundleName: m.BundleName,
|
||||||
Month: m.Month,
|
Month: m.Month,
|
||||||
ExpiredTime: m.ExpiredAt.UnixMilli(),
|
ExpiredTime: m.ExpiredAt.UnixMilli(),
|
||||||
@ -207,6 +208,41 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundl
|
|||||||
return resp, nil
|
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) {
|
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
||||||
data, err := dao.GetBundleBalanceByUserId(req)
|
data, err := dao.GetBundleBalanceByUserId(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -262,6 +298,23 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.
|
|||||||
return result, nil
|
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 和 默认事件
|
// 查询失败返回2 和 默认事件
|
||||||
func GetBundleBalanceByOrderUUID(orderUUID string) (time.Time, int, error) {
|
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) {
|
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
|
||||||
data := model.BundleBalanceUsePo{
|
data := model.BundleBalanceUsePo{
|
||||||
UserId: int(req.UserId),
|
UserId: int(req.UserId),
|
||||||
|
OrderUUID: req.OrderUUID,
|
||||||
AccountNumber: int(req.AccountConsumptionNumber),
|
AccountNumber: int(req.AccountConsumptionNumber),
|
||||||
ImageNumber: int(req.ImageConsumptionNumber),
|
ImageNumber: int(req.ImageConsumptionNumber),
|
||||||
VideoNumber: int(req.VideoConsumptionNumber),
|
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.MonthlyBundleLimitCompetitiveNumber = cal(data, data.BundleLimitCompetitiveNumber, data.MonthlyLimitCompetitiveQuotaNumber, now)
|
||||||
data.MonthlyIncreaseLimitCompetitiveNumber = cal(data, data.IncreaseLimitCompetitiveNumber, data.MonthlyLimitCompetitiveQuotaNumber, now)
|
data.MonthlyIncreaseLimitCompetitiveNumber = cal(data, data.IncreaseLimitCompetitiveNumber, data.MonthlyLimitCompetitiveQuotaNumber, now)
|
||||||
|
|
||||||
|
data.BundleType = int(orderInfo.OrderType)
|
||||||
err = dao.CreateBundleBalance(data)
|
err = dao.CreateBundleBalance(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
@ -710,9 +765,32 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
|||||||
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
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) {
|
func GetBundleBalanceLayout(req *bundle.GetBundleBalanceLayoutReq) (*bundle.GetBundleBalanceLayoutResp, error) {
|
||||||
data, err := dao.GetBundleBalanceLayout(req)
|
data, err := dao.GetBundleBalanceLayout(req)
|
||||||
if err != nil { // 返回默认值
|
if err != nil { // 返回默认值
|
||||||
|
if req.BundleType == 2 {
|
||||||
|
return &bundle.GetBundleBalanceLayoutResp{
|
||||||
|
Data: buildDefaultPayLaterBalanceLayout(),
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
return &bundle.GetBundleBalanceLayoutResp{
|
return &bundle.GetBundleBalanceLayoutResp{
|
||||||
Data: buildDefaultBalanceLayout(),
|
Data: buildDefaultBalanceLayout(),
|
||||||
}, nil
|
}, nil
|
||||||
@ -833,3 +911,39 @@ func buildDefaultBalanceLayout() string {
|
|||||||
b, _ := json.Marshal(jsonMap)
|
b, _ := json.Marshal(jsonMap)
|
||||||
return string(b)
|
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)
|
||||||
|
}
|
||||||
|
|||||||
@ -68,17 +68,20 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
}
|
}
|
||||||
//套餐主表数据
|
//套餐主表数据
|
||||||
bundleProfile := &model.BundleProfile{
|
bundleProfile := &model.BundleProfile{
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
Sort: req.Sort,
|
Sort: req.Sort,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Price: req.Price,
|
Price: req.Price,
|
||||||
PriceType: req.PriceType,
|
PriceType: req.PriceType,
|
||||||
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
|
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/template-25122501.pdf",
|
||||||
ImgOption: int8(req.ImgOption),
|
PayLaterContract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/contract/saas/20260611-套餐的先用后付合同.pdf",
|
||||||
BgImg1: req.BgImg1,
|
ImgOption: int8(req.ImgOption),
|
||||||
BgImg2: req.BgImg2,
|
BgImg1: req.BgImg1,
|
||||||
ShelfStatus: 2, //默认初始状态为2-下架
|
BgImg2: req.BgImg2,
|
||||||
FontColor: req.FontColor,
|
ShelfStatus: model.BundleShelfStatusDown, //默认初始状态为2-下架
|
||||||
|
FontColor: req.FontColor,
|
||||||
|
BundleType: req.BundleType,
|
||||||
|
PayLaterTime: req.PayLaterTime,
|
||||||
}
|
}
|
||||||
bundleLang := &model.BundleProfileLang{
|
bundleLang := &model.BundleProfileLang{
|
||||||
Name: req.Name,
|
Name: req.Name,
|
||||||
@ -202,6 +205,8 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
serviceName = "账号数"
|
serviceName = "账号数"
|
||||||
case msg.AvailableTimeService:
|
case msg.AvailableTimeService:
|
||||||
serviceName = "可用时长"
|
serviceName = "可用时长"
|
||||||
|
case msg.CompetitiveService:
|
||||||
|
serviceName = "竞品数"
|
||||||
}
|
}
|
||||||
return res, fmt.Errorf("服务类型%s的额度不兼容:套餐权益额度为%d,附加权益额度为%d",
|
return res, fmt.Errorf("服务类型%s的额度不兼容:套餐权益额度为%d,附加权益额度为%d",
|
||||||
serviceName, benefitsQuota.QuotaValue, optionalQuota.QuotaValue)
|
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 {
|
if req.Language == msg.ZH_CN {
|
||||||
updateBundle := map[string]interface{}{
|
updateBundle := map[string]interface{}{
|
||||||
"name": req.Name,
|
"name": req.Name,
|
||||||
"sort": req.Sort,
|
"sort": req.Sort,
|
||||||
"content": req.Content,
|
"content": req.Content,
|
||||||
"price": req.Price,
|
"price": req.Price,
|
||||||
"price_type": req.PriceType,
|
"price_type": req.PriceType,
|
||||||
"img_option": req.ImgOption,
|
"img_option": req.ImgOption,
|
||||||
"bg_img1": req.BgImg1,
|
"bg_img1": req.BgImg1,
|
||||||
"bg_img2": req.BgImg2,
|
"bg_img2": req.BgImg2,
|
||||||
"font_color": req.FontColor,
|
"font_color": req.FontColor,
|
||||||
|
"bundle_type": req.BundleType,
|
||||||
|
"pay_later_time": req.PayLaterTime,
|
||||||
}
|
}
|
||||||
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
|
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
|
||||||
return res, errors.New("更新套餐信息失败")
|
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) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||||
res = new(bundle.BundleDetailResponseV2)
|
res = new(bundle.BundleDetailResponseV2)
|
||||||
bundleProfile := &bundle.BundleProfile{}
|
bundleProfile := &bundle.BundleProfile{}
|
||||||
|
var bundleProfileLang *bundle.BundleProfileLang
|
||||||
|
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
return res, errors.New("缺少套餐UUID")
|
return res, errors.New("缺少套餐UUID")
|
||||||
@ -341,22 +349,56 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, errors.New("获取套餐信息失败")
|
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 {
|
if detail != nil {
|
||||||
bundleProfile = &bundle.BundleProfile{
|
bundleProfile = &bundle.BundleProfile{
|
||||||
Uuid: detail.UUID,
|
Uuid: detail.UUID,
|
||||||
Name: detail.Name,
|
Name: bundleProfileLang.Name,
|
||||||
Content: detail.Content,
|
Content: bundleProfileLang.Content,
|
||||||
Price: detail.Price,
|
Price: bundleProfileLang.Price,
|
||||||
PriceType: detail.PriceType,
|
PriceType: bundleProfileLang.PriceType,
|
||||||
ImgOption: int32(detail.ImgOption),
|
ImgOption: int32(detail.ImgOption),
|
||||||
BgImg1: detail.BgImg1,
|
BgImg1: detail.BgImg1,
|
||||||
BgImg2: detail.BgImg2,
|
BgImg2: detail.BgImg2,
|
||||||
FontColor: detail.FontColor,
|
Language: req.Language,
|
||||||
Sort: detail.Sort,
|
FontColor: detail.FontColor,
|
||||||
ShelfStatus: detail.ShelfStatus,
|
Sort: detail.Sort,
|
||||||
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
|
ShelfStatus: detail.ShelfStatus,
|
||||||
UpdatedAt: detail.UpdatedAt.Format("2006-01-02 15:04:05"),
|
CreatedAt: detail.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||||
Contract: detail.Contract,
|
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 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
var valueUuids []string
|
var valueUuids []string
|
||||||
@ -421,20 +463,22 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0, len(detail.BundleProfileLang))
|
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0, len(detail.BundleProfileLang))
|
||||||
for _, lang := range detail.BundleProfileLang {
|
for _, lang := range detail.BundleProfileLang {
|
||||||
bundleProfileLangs = append(bundleProfileLangs, &bundle.BundleProfileLang{
|
bundleProfileLangs = append(bundleProfileLangs, &bundle.BundleProfileLang{
|
||||||
Uuid: lang.UUID,
|
Uuid: lang.UUID,
|
||||||
Name: lang.Name,
|
Name: lang.Name,
|
||||||
Price: lang.Price,
|
Price: lang.Price,
|
||||||
PriceType: lang.PriceType,
|
PriceType: lang.PriceType,
|
||||||
Content: lang.Content,
|
Content: lang.Content,
|
||||||
Language: lang.Language,
|
Language: lang.Language,
|
||||||
ImgOption: int32(detail.ImgOption),
|
PayLaterTime: int64(lang.PayLaterTime),
|
||||||
BgImg1: detail.BgImg1,
|
ImgOption: int32(detail.ImgOption),
|
||||||
BgImg2: detail.BgImg2,
|
BgImg1: detail.BgImg1,
|
||||||
FontColor: detail.FontColor,
|
BgImg2: detail.BgImg2,
|
||||||
Sort: detail.Sort,
|
FontColor: detail.FontColor,
|
||||||
ShelfStatus: detail.ShelfStatus,
|
Sort: detail.Sort,
|
||||||
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
|
ShelfStatus: detail.ShelfStatus,
|
||||||
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
|
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
|
bundleProfile.BundleProfileLang = bundleProfileLangs
|
||||||
@ -469,6 +513,9 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
|
|||||||
res.Sort = detail.Sort
|
res.Sort = detail.Sort
|
||||||
res.ShelfStatus = detail.ShelfStatus
|
res.ShelfStatus = detail.ShelfStatus
|
||||||
res.Contract = detail.Contract
|
res.Contract = detail.Contract
|
||||||
|
res.PayLaterContract = detail.PayLaterContract
|
||||||
|
res.BundleType = int64(detail.BundleType)
|
||||||
|
res.PayLaterTime = int64(detail.PayLaterTime)
|
||||||
if len(detail.BundleToValueAddService) > 0 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
var serviceLangInfos []*bundle.ServiceLangInfo
|
var serviceLangInfos []*bundle.ServiceLangInfo
|
||||||
for _, service := range detail.BundleToValueAddService {
|
for _, service := range detail.BundleToValueAddService {
|
||||||
@ -486,6 +533,7 @@ func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProf
|
|||||||
res.PriceType = lang.PriceType
|
res.PriceType = lang.PriceType
|
||||||
res.Content = lang.Content
|
res.Content = lang.Content
|
||||||
res.Language = lang.Language
|
res.Language = lang.Language
|
||||||
|
res.PayLaterTime = int64(lang.PayLaterTime)
|
||||||
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
|
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")
|
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,6 +214,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
valueAddService := &model.ValueAddService{
|
valueAddService := &model.ValueAddService{
|
||||||
ServiceName: in.ServiceName,
|
ServiceName: in.ServiceName,
|
||||||
ServiceType: in.ServiceType,
|
ServiceType: in.ServiceType,
|
||||||
|
SourceFrom: in.SourceFrom,
|
||||||
}
|
}
|
||||||
valueAddServiceLang := &model.ValueAddServiceLang{
|
valueAddServiceLang := &model.ValueAddServiceLang{
|
||||||
ServiceName: in.ServiceName,
|
ServiceName: in.ServiceName,
|
||||||
|
|||||||
@ -8,13 +8,24 @@ import (
|
|||||||
"gorm.io/plugin/soft_delete"
|
"gorm.io/plugin/soft_delete"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BundleTypeBasic = 1 // 基础套餐
|
||||||
|
BundleTypePostpaid = 2 // 先用后付套餐
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BundleShelfStatusUp = 1 // 上架
|
||||||
|
BundleShelfStatusDown = 2 // 下架
|
||||||
|
)
|
||||||
|
|
||||||
type BundleProfile struct {
|
type BundleProfile struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
||||||
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
||||||
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);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:美元"`
|
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:合同有效时长"`
|
ContractDuration int `json:"contractDuration" gorm:"column:contract_duration;type:int;comment:合同有效时长"`
|
||||||
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
||||||
CompanySign string `json:"companySign" gorm:"column:company_sign;type:varchar(1024);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:字体颜色"`
|
FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);comment:字体颜色"`
|
||||||
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);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:背景图-我的"`
|
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"`
|
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
|
||||||
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
|
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
|
||||||
}
|
}
|
||||||
type BundleProfileLang struct {
|
type BundleProfileLang struct {
|
||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
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"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
|
||||||
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
|
||||||
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);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:美元"`
|
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
|
||||||
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
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(中繁英德日)"`
|
PayLaterTime int64 `json:"payLaterTime" gorm:"column:pay_later_time;type:int;default:1;comment:先用后付套餐的后付时间,单位为天"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
||||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
DeletedAt soft_delete.DeletedAt
|
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
|
DeletedAt soft_delete.DeletedAt
|
||||||
}
|
}
|
||||||
type BundleToValueAddService struct {
|
type BundleToValueAddService struct {
|
||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
||||||
@ -158,6 +172,25 @@ type BundleBalancePo struct {
|
|||||||
BundleBalance
|
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 {
|
type UserBundleBalancePo struct {
|
||||||
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
|
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
|
||||||
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
|
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
|
||||||
@ -173,13 +206,20 @@ type UserBundleBalancePo struct {
|
|||||||
BundleBalance
|
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 {
|
type BundleBalance struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
UserId int `gorm:"column:user_id;not null"`
|
UserId int `gorm:"column:user_id;not null"`
|
||||||
Month string `gorm:"column:month;type:varchar(32);not null;index:idx_month"`
|
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"`
|
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"`
|
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"`
|
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:套餐账号总数"`
|
BundleAccountNumber int `gorm:"column:bundle_account_number;not null;comment:套餐账号总数"`
|
||||||
@ -347,6 +387,7 @@ func (*BundleActivate) TableName() string {
|
|||||||
|
|
||||||
type BundleBalanceUsePo struct {
|
type BundleBalanceUsePo struct {
|
||||||
UserId int
|
UserId int
|
||||||
|
OrderUUID string
|
||||||
AccountNumber int
|
AccountNumber int
|
||||||
VideoNumber int
|
VideoNumber int
|
||||||
ImageNumber int
|
ImageNumber int
|
||||||
@ -398,8 +439,9 @@ type BundleExport struct {
|
|||||||
|
|
||||||
type BundleBalanceLayout struct {
|
type BundleBalanceLayout struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
UserId uint64 `gorm:"column:user_id;not null;unique"`
|
UserId uint64 `gorm:"column:user_id;not null;unique"`
|
||||||
Data string `gorm:"column:data;type:longtext;not null"`
|
Data string `gorm:"column:data;type:longtext;not null"`
|
||||||
|
BundleType int32 `gorm:"column:bundle_type;not null"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 总销售情况
|
// 总销售情况
|
||||||
|
|||||||
@ -35,7 +35,8 @@ type ValueAddService struct {
|
|||||||
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
|
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"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
||||||
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
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"`
|
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
|
||||||
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
|
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
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"`
|
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"`
|
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
|
||||||
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
|
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:总价"`
|
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:原单价"`
|
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:增值服务总价"` //总价模式不合理,该字段暂时无用
|
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //总价模式不合理,该字段暂时无用
|
||||||
|
|||||||
295
pb/bundle.proto
295
pb/bundle.proto
@ -55,13 +55,16 @@ service Bundle {
|
|||||||
rpc UpdateBundleBalance(UpdateBundleBalanceReq) returns (UpdateBundleBalanceResp) {} // 更新余量表数据(用于每月定时任务,谨慎调用)
|
rpc UpdateBundleBalance(UpdateBundleBalanceReq) returns (UpdateBundleBalanceResp) {} // 更新余量表数据(用于每月定时任务,谨慎调用)
|
||||||
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展
|
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展
|
||||||
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
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 GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} // 余量信息
|
||||||
|
rpc GetBundleOrderListByUserId(GetBundleOrderListByUserIdReq) returns (GetBundleOrderListByUserIdResp) {} // 根据用户ID查询订单列表(包含订单基本信息和订单对应的余量信息)
|
||||||
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
|
rpc GetBundleBalanceByOrderUUID(GetBundleBalanceByOrderUUIDReq) returns (GetBundleBalanceByOrderUUIDResp) {}
|
||||||
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
||||||
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 修改余量信息
|
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 修改余量信息
|
||||||
rpc BundleActivate(BundleActivateReq) returns (BundleActivateResp) {} // 用户套餐激活
|
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 GetBundleBalanceLayout(GetBundleBalanceLayoutReq) returns (GetBundleBalanceLayoutResp) {} // 余量布局
|
||||||
rpc SetBundleBalanceLayout(SetBundleBalanceLayoutReq) returns (SetBundleBalanceLayoutResp) {} // 余量布局
|
rpc SetBundleBalanceLayout(SetBundleBalanceLayoutReq) returns (SetBundleBalanceLayoutResp) {} // 余量布局
|
||||||
|
|
||||||
@ -358,21 +361,24 @@ message BundleProfile {
|
|||||||
int64 priceType = 4 [json_name = "priceType"];
|
int64 priceType = 4 [json_name = "priceType"];
|
||||||
string content = 5 [json_name = "content"];
|
string content = 5 [json_name = "content"];
|
||||||
string contract = 6 [json_name = "contract"];
|
string contract = 6 [json_name = "contract"];
|
||||||
string language = 7 [json_name = "language"];
|
string payLaterContract = 7 [json_name = "payLaterContract"];
|
||||||
string createdAt = 8 [json_name = "createdAt"];
|
string language = 8 [json_name = "language"];
|
||||||
string updatedAt = 9 [json_name = "updatedAt"];
|
string createdAt = 9 [json_name = "createdAt"];
|
||||||
string companySign = 10 [json_name = "companySign"];
|
string updatedAt = 10 [json_name = "updatedAt"];
|
||||||
int64 contractDuration = 11 [json_name = "contractDuration"];
|
string companySign = 11 [json_name = "companySign"];
|
||||||
string bundleCommonUid = 12 [json_name = "bundleCommonUid"];
|
int64 contractDuration = 12 [json_name = "contractDuration"];
|
||||||
int64 sort = 13 [json_name = "sort"];
|
string bundleCommonUid = 13 [json_name = "bundleCommonUid"];
|
||||||
string bgImg1 = 14 [json_name = "bgImg1"];
|
int64 sort = 14 [json_name = "sort"];
|
||||||
string bgImg2 = 15 [json_name = "bgImg2"];
|
string bgImg1 = 15 [json_name = "bgImg1"];
|
||||||
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
string bgImg2 = 16 [json_name = "bgImg2"];
|
||||||
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
|
int64 shelfStatus = 17 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
||||||
repeated SelectValueAdditionalService selectValueAdditionalService = 18 [json_name = "SelectValueAdditionalService"];
|
repeated SelectValueAddService selectValueAddService = 18 [json_name = "SelectValueAddService"];
|
||||||
repeated BundleProfileLang bundleProfileLang = 19 [json_name = "bundleProfileLang"];
|
repeated SelectValueAdditionalService selectValueAdditionalService = 19 [json_name = "SelectValueAdditionalService"];
|
||||||
int32 imgOption = 20 [json_name = "imgOption"];
|
repeated BundleProfileLang bundleProfileLang = 20 [json_name = "bundleProfileLang"];
|
||||||
string fontColor = 21 [json_name = "fontColor"];
|
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 {
|
message BundleProfileLang {
|
||||||
string uuid = 1 [json_name = "uuid"];
|
string uuid = 1 [json_name = "uuid"];
|
||||||
@ -384,15 +390,18 @@ message BundleProfileLang {
|
|||||||
string createdAt = 7 [json_name = "createdAt"];
|
string createdAt = 7 [json_name = "createdAt"];
|
||||||
string updatedAt = 8 [json_name = "updatedAt"];
|
string updatedAt = 8 [json_name = "updatedAt"];
|
||||||
string contract = 9 [json_name = "contract"];
|
string contract = 9 [json_name = "contract"];
|
||||||
string companySign = 10 [json_name = "companySign"];
|
string payLaterContract = 10 [json_name = "payLaterContract"];
|
||||||
int64 contractDuration = 11 [json_name = "contractDuration"];
|
string companySign = 11 [json_name = "companySign"];
|
||||||
string fontColor = 12 [json_name = "fontColor"];
|
int64 contractDuration = 12 [json_name = "contractDuration"];
|
||||||
int64 sort = 13 [json_name = "sort"];
|
string fontColor = 13 [json_name = "fontColor"];
|
||||||
string bgImg1 = 14 [json_name = "bgImg1"];
|
int64 sort = 14 [json_name = "sort"];
|
||||||
string bgImg2 = 15 [json_name = "bgImg2"];
|
string bgImg1 = 15 [json_name = "bgImg1"];
|
||||||
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
string bgImg2 = 16 [json_name = "bgImg2"];
|
||||||
int32 imgOption = 17 [json_name = "imgOption"];
|
int64 shelfStatus = 17 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
||||||
repeated ServiceLangInfo serviceLangInfo = 18 [json_name = "serviceLangInfo"];//增值服务信息
|
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"];
|
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,6 +450,7 @@ message BundleListRequest {
|
|||||||
string name = 3 [json_name = "name"];
|
string name = 3 [json_name = "name"];
|
||||||
string content = 4 [json_name = "content"];
|
string content = 4 [json_name = "content"];
|
||||||
string language = 5 [json_name = "language"];
|
string language = 5 [json_name = "language"];
|
||||||
|
int32 bundleType = 6 [json_name = "bundleType"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message BundleListResponse {
|
message BundleListResponse {
|
||||||
@ -670,6 +680,7 @@ message ValueAddServiceLang {
|
|||||||
int32 quotaType = 12 [json_name = "quotaType"]; //额度类型 1;不限额度 2:每月限额度
|
int32 quotaType = 12 [json_name = "quotaType"]; //额度类型 1;不限额度 2:每月限额度
|
||||||
int32 quotaValue = 13 [json_name = "quotaValue"]; //额度值
|
int32 quotaValue = 13 [json_name = "quotaValue"]; //额度值
|
||||||
bool isExpired = 14 [json_name = "isExpired"]; //是否过期作废 false:不作废 true:作废
|
bool isExpired = 14 [json_name = "isExpired"]; //是否过期作废 false:不作废 true:作废
|
||||||
|
int32 sourceFrom = 15 [json_name = "sourceFrom"]; //归属 1:普通套餐 2:先用后付套餐
|
||||||
}
|
}
|
||||||
//增值服务价格选项
|
//增值服务价格选项
|
||||||
message ValueAddPriceOptions {
|
message ValueAddPriceOptions {
|
||||||
@ -688,6 +699,7 @@ message ValueAddServiceListRequest {
|
|||||||
string name = 3 [json_name = "name"]; // 服务名称
|
string name = 3 [json_name = "name"]; // 服务名称
|
||||||
int32 serviceType = 4 [json_name = "serviceType"]; // 服务类型
|
int32 serviceType = 4 [json_name = "serviceType"]; // 服务类型
|
||||||
string language = 5 [json_name = "language"]; // 语言(历史遗留,暂未使用)
|
string language = 5 [json_name = "language"]; // 语言(历史遗留,暂未使用)
|
||||||
|
int32 sourceFrom = 6 [json_name = "sourceFrom"]; // 归属 1:普通套餐 2:先用后付套餐
|
||||||
}
|
}
|
||||||
message ValueAddServiceListResponse {
|
message ValueAddServiceListResponse {
|
||||||
int32 total = 1 [json_name = "total"];
|
int32 total = 1 [json_name = "total"];
|
||||||
@ -794,6 +806,45 @@ message GetBundleBalanceListReq{
|
|||||||
int32 pageSize = 10;
|
int32 pageSize = 10;
|
||||||
repeated string month = 11;
|
repeated string month = 11;
|
||||||
int32 statusType = 12;
|
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{
|
message GetBundleBalanceReq{
|
||||||
@ -818,101 +869,102 @@ message BundleBalanceItem {
|
|||||||
string payTime = 8; // 下单时间
|
string payTime = 8; // 下单时间
|
||||||
int64 startTime = 9; // 开始有效时间
|
int64 startTime = 9; // 开始有效时间
|
||||||
int64 expiredTime = 10; // 过期时间
|
int64 expiredTime = 10; // 过期时间
|
||||||
string month = 11; // 所属月份
|
int64 bundleType = 11;//套餐类型
|
||||||
int32 bought = 12; // 购买状态
|
string month = 12; // 所属月份
|
||||||
|
int32 bought = 13; // 购买状态
|
||||||
|
|
||||||
// 套餐账号数
|
// 套餐账号数
|
||||||
int32 bundleAccountNumber = 13; // 当前可用套餐账号数
|
int32 bundleAccountNumber = 14; // 当前可用套餐账号数
|
||||||
int32 increaseAccountNumber = 14; // 当前可用增值账号数
|
int32 increaseAccountNumber = 15; // 当前可用增值账号数
|
||||||
int32 bundleAccountConsumptionNumber = 15; // 当前已用套餐账号数
|
int32 bundleAccountConsumptionNumber = 16; // 当前已用套餐账号数
|
||||||
int32 increaseAccountConsumptionNumber = 16; // 当前已用增值账号数
|
int32 increaseAccountConsumptionNumber = 17; // 当前已用增值账号数
|
||||||
|
|
||||||
// 视频类统计
|
// 视频类统计
|
||||||
int32 bundleVideoNumber = 17; // 当前可用套餐视频数
|
int32 bundleVideoNumber = 18; // 当前可用套餐视频数
|
||||||
int32 increaseVideoNumber = 18; // 当前可用增值视频数
|
int32 increaseVideoNumber = 19; // 当前可用增值视频数
|
||||||
int32 bundleVideoConsumptionNumber = 19; // 当前已用套餐视频数
|
int32 bundleVideoConsumptionNumber = 20; // 当前已用套餐视频数
|
||||||
int32 increaseVideoConsumptionNumber = 20; // 当前已用增值视频数
|
int32 increaseVideoConsumptionNumber = 21; // 当前已用增值视频数
|
||||||
int32 invalidBundleVideoNumber = 21; // 当前作废套餐视频数
|
int32 invalidBundleVideoNumber = 22; // 当前作废套餐视频数
|
||||||
int32 invalidIncreaseVideoNumber = 22; // 当前作废增值视频数
|
int32 invalidIncreaseVideoNumber = 23; // 当前作废增值视频数
|
||||||
int32 monthlyNewBundleVideoNumber = 23; // 当月新增套餐视频数
|
int32 monthlyNewBundleVideoNumber = 24; // 当月新增套餐视频数
|
||||||
int32 monthlyNewIncreaseVideoNumber = 24; // 当月新增增值视频数
|
int32 monthlyNewIncreaseVideoNumber = 25; // 当月新增增值视频数
|
||||||
int32 monthlyBundleVideoNumber = 25; // 当月可用套餐视频数
|
int32 monthlyBundleVideoNumber = 26; // 当月可用套餐视频数
|
||||||
int32 monthlyIncreaseVideoNumber = 26; // 当月可用增值视频数
|
int32 monthlyIncreaseVideoNumber = 27; // 当月可用增值视频数
|
||||||
int32 monthBundleVideoConsumptionNumber = 27; // 当月使用套餐视频数
|
int32 monthBundleVideoConsumptionNumber = 28; // 当月使用套餐视频数
|
||||||
int32 monthIncreaseVideoConsumptionNumber = 28; // 当月使用增值视频数
|
int32 monthIncreaseVideoConsumptionNumber = 29; // 当月使用增值视频数
|
||||||
int32 monthlyInvalidBundleVideoNumber = 29; // 当月作废套餐视频数
|
int32 monthlyInvalidBundleVideoNumber = 30; // 当月作废套餐视频数
|
||||||
int32 monthlyInvalidIncreaseVideoNumber = 30; // 当月作废增值视频数
|
int32 monthlyInvalidIncreaseVideoNumber = 31; // 当月作废增值视频数
|
||||||
|
|
||||||
// 图文类统计
|
// 图文类统计
|
||||||
int32 bundleImageNumber = 31; // 当前可用套餐图文数
|
int32 bundleImageNumber = 32; // 当前可用套餐图文数
|
||||||
int32 increaseImageNumber = 32; // 当前可用增值图文数
|
int32 increaseImageNumber = 33; // 当前可用增值图文数
|
||||||
int32 bundleImageConsumptionNumber = 33; // 当前已用套餐图文数
|
int32 bundleImageConsumptionNumber = 34; // 当前已用套餐图文数
|
||||||
int32 increaseImageConsumptionNumber = 34; // 当前已用增值图文数
|
int32 increaseImageConsumptionNumber = 35; // 当前已用增值图文数
|
||||||
int32 invalidBundleImageNumber = 35; // 当前作废套餐图文数
|
int32 invalidBundleImageNumber = 36; // 当前作废套餐图文数
|
||||||
int32 invalidIncreaseImageNumber = 36; // 当前作废增值图文数
|
int32 invalidIncreaseImageNumber = 37; // 当前作废增值图文数
|
||||||
int32 monthlyNewBundleImageNumber = 37; // 当月新增套餐图文数
|
int32 monthlyNewBundleImageNumber = 38; // 当月新增套餐图文数
|
||||||
int32 monthlyNewIncreaseImageNumber = 38; // 当月新增增值图文数
|
int32 monthlyNewIncreaseImageNumber = 39; // 当月新增增值图文数
|
||||||
int32 monthlyBundleImageNumber = 39; // 当月可用套餐图文数
|
int32 monthlyBundleImageNumber = 40; // 当月可用套餐图文数
|
||||||
int32 monthlyIncreaseImageNumber = 40; // 当月可用增值图文数
|
int32 monthlyIncreaseImageNumber = 41; // 当月可用增值图文数
|
||||||
int32 monthBundleImageConsumptionNumber = 41; // 当月使用套餐图文数
|
int32 monthBundleImageConsumptionNumber = 42; // 当月使用套餐图文数
|
||||||
int32 monthIncreaseImageConsumptionNumber = 42; // 当月使用增值图文数
|
int32 monthIncreaseImageConsumptionNumber = 43; // 当月使用增值图文数
|
||||||
int32 monthlyInvalidBundleImageNumber = 43; // 当月作废套餐图文数
|
int32 monthlyInvalidBundleImageNumber = 44; // 当月作废套餐图文数
|
||||||
int32 monthlyInvalidIncreaseImageNumber = 44; // 当月作废增值图文数
|
int32 monthlyInvalidIncreaseImageNumber = 45; // 当月作废增值图文数
|
||||||
|
|
||||||
// 数据分析类统计
|
// 数据分析类统计
|
||||||
int32 bundleDataAnalysisNumber = 45; // 当前可用套餐数据数
|
int32 bundleDataAnalysisNumber = 46; // 当前可用套餐数据数
|
||||||
int32 increaseDataAnalysisNumber = 46; // 当前可用增值数据数
|
int32 increaseDataAnalysisNumber = 47; // 当前可用增值数据数
|
||||||
int32 bundleDataAnalysisConsumptionNumber = 47; // 当前已用套餐数据数
|
int32 bundleDataAnalysisConsumptionNumber = 48; // 当前已用套餐数据数
|
||||||
int32 increaseDataAnalysisConsumptionNumber = 48; // 当前已用增值数据数
|
int32 increaseDataAnalysisConsumptionNumber = 49; // 当前已用增值数据数
|
||||||
int32 invalidBundleDataAnalysisNumber = 49; // 当前作废套餐数据数
|
int32 invalidBundleDataAnalysisNumber = 50; // 当前作废套餐数据数
|
||||||
int32 invalidIncreaseDataAnalysisNumber = 50; // 当前作废增值数据数
|
int32 invalidIncreaseDataAnalysisNumber = 51; // 当前作废增值数据数
|
||||||
int32 monthlyNewBundleDataAnalysisNumber = 51; // 当月新增套餐数据数
|
int32 monthlyNewBundleDataAnalysisNumber = 52; // 当月新增套餐数据数
|
||||||
int32 monthlyNewIncreaseDataAnalysisNumber = 52; // 当月新增增值数据数
|
int32 monthlyNewIncreaseDataAnalysisNumber = 53; // 当月新增增值数据数
|
||||||
int32 monthlyBundleDataAnalysisNumber = 53; // 当月可用套餐数据分析数
|
int32 monthlyBundleDataAnalysisNumber = 54; // 当月可用套餐数据分析数
|
||||||
int32 monthlyIncreaseDataAnalysisNumber = 54; // 当月可用增值数据分析数
|
int32 monthlyIncreaseDataAnalysisNumber = 55; // 当月可用增值数据分析数
|
||||||
int32 monthBundleDataAnalysisConsumptionNumber = 55; // 当月使用套餐数据数
|
int32 monthBundleDataAnalysisConsumptionNumber = 56; // 当月使用套餐数据数
|
||||||
int32 monthIncreaseDataAnalysisConsumptionNumber = 56; // 当月使用增值数据数
|
int32 monthIncreaseDataAnalysisConsumptionNumber = 57; // 当月使用增值数据数
|
||||||
int32 monthlyInvalidBundleDataAnalysisNumber = 57; // 当月作废套餐数据数
|
int32 monthlyInvalidBundleDataAnalysisNumber = 58; // 当月作废套餐数据数
|
||||||
int32 monthlyInvalidIncreaseDataAnalysisNumber = 58; // 当月作废增值数据数
|
int32 monthlyInvalidIncreaseDataAnalysisNumber = 59; // 当月作废增值数据数
|
||||||
|
|
||||||
// 竞品数
|
// 竞品数
|
||||||
int32 bundleCompetitiveNumber = 59; // 当前可用套餐竞品数
|
int32 bundleCompetitiveNumber = 60; // 当前可用套餐竞品数
|
||||||
int32 increaseCompetitiveNumber = 60; // 当前可用增值竞品数
|
int32 increaseCompetitiveNumber = 61; // 当前可用增值竞品数
|
||||||
int32 bundleCompetitiveConsumptionNumber = 61; // 当前已用套餐竞品数
|
int32 bundleCompetitiveConsumptionNumber = 62; // 当前已用套餐竞品数
|
||||||
int32 increaseCompetitiveConsumptionNumber = 62; // 当前已用增值竞品数
|
int32 increaseCompetitiveConsumptionNumber = 63; // 当前已用增值竞品数
|
||||||
int32 invalidBundleCompetitiveNumber = 63; // 当前作废套餐竞品数
|
int32 invalidBundleCompetitiveNumber = 64; // 当前作废套餐竞品数
|
||||||
int32 invalidIncreaseCompetitiveNumber = 64; // 当前作废增值竞品数
|
int32 invalidIncreaseCompetitiveNumber = 65; // 当前作废增值竞品数
|
||||||
int32 monthlyNewBundleCompetitiveNumber = 65; // 当月新增套餐竞品数
|
int32 monthlyNewBundleCompetitiveNumber = 66; // 当月新增套餐竞品数
|
||||||
int32 monthlyNewIncreaseCompetitiveNumber = 66; // 当月新增增值竞品数
|
int32 monthlyNewIncreaseCompetitiveNumber = 67; // 当月新增增值竞品数
|
||||||
int32 monthlyBundleCompetitiveNumber = 67; // 当月可用套餐竞品数
|
int32 monthlyBundleCompetitiveNumber = 68; // 当月可用套餐竞品数
|
||||||
int32 monthlyIncreaseCompetitiveNumber = 68; // 当月可用增值竞品数
|
int32 monthlyIncreaseCompetitiveNumber = 69; // 当月可用增值竞品数
|
||||||
int32 monthBundleCompetitiveConsumptionNumber = 69; // 当月使用套餐竞品数
|
int32 monthBundleCompetitiveConsumptionNumber = 70; // 当月使用套餐竞品数
|
||||||
int32 monthIncreaseCompetitiveConsumptionNumber = 70; // 当月使用增值竞品数
|
int32 monthIncreaseCompetitiveConsumptionNumber = 71; // 当月使用增值竞品数
|
||||||
int32 monthlyInvalidBundleCompetitiveNumber = 71; // 当月作废套餐竞品数
|
int32 monthlyInvalidBundleCompetitiveNumber = 72; // 当月作废套餐竞品数
|
||||||
int32 monthlyInvalidIncreaseCompetitiveNumber = 72; // 当月作废增值竞品数
|
int32 monthlyInvalidIncreaseCompetitiveNumber = 73; // 当月作废增值竞品数
|
||||||
|
|
||||||
// 手动扩展数据
|
// 手动扩展数据
|
||||||
int32 monthlyNewManualAccountNumber = 73; // 当月新增手动扩展账号数
|
int32 monthlyNewManualAccountNumber = 74; // 当月新增手动扩展账号数
|
||||||
int32 monthlyNewManualVideoNumber = 74; // 当月新增手动扩展视频数
|
int32 monthlyNewManualVideoNumber = 75; // 当月新增手动扩展视频数
|
||||||
int32 monthlyNewManualImageNumber = 75; // 当月新增手动扩展图文数
|
int32 monthlyNewManualImageNumber = 76; // 当月新增手动扩展图文数
|
||||||
int32 monthlyNewManualDataAnalysisNumber = 76; // 当月新增手动扩展数据数
|
int32 monthlyNewManualDataAnalysisNumber = 77; // 当月新增手动扩展数据数
|
||||||
int32 monthlyNewManualCompetitiveNumber = 77; // 当月新增手动扩展竞品数
|
int32 monthlyNewManualCompetitiveNumber = 78; // 当月新增手动扩展竞品数
|
||||||
int32 monthlyNewDurationNumber = 78; // 当月新增手动扩展时长(日)
|
int32 monthlyNewDurationNumber = 79; // 当月新增手动扩展时长(日)
|
||||||
int32 monthlyManualAccountConsumptionNumber = 79; // 当月已用手动扩展账号数
|
int32 monthlyManualAccountConsumptionNumber = 80; // 当月已用手动扩展账号数
|
||||||
int32 monthlyManualVideoConsumptionNumber = 80; // 当月已用手动扩展视频数
|
int32 monthlyManualVideoConsumptionNumber = 81; // 当月已用手动扩展视频数
|
||||||
int32 monthlyManualImageConsumptionNumber = 81; // 当月已用手动扩展图文数
|
int32 monthlyManualImageConsumptionNumber = 82; // 当月已用手动扩展图文数
|
||||||
int32 monthlyManualDataAnalysisConsumptionNumber = 82; // 当月已用手动扩展数据数
|
int32 monthlyManualDataAnalysisConsumptionNumber = 83; // 当月已用手动扩展数据数
|
||||||
int32 monthlyManualCompetitiveConsumptionNumber = 83; // 当月已用手动扩展竞品数
|
int32 monthlyManualCompetitiveConsumptionNumber = 84; // 当月已用手动扩展竞品数
|
||||||
int32 manualAccountConsumptionNumber = 84; // 已用手动扩展账号数
|
int32 manualAccountConsumptionNumber = 85; // 已用手动扩展账号数
|
||||||
int32 manualVideoConsumptionNumber = 85; // 已用手动扩展视频数
|
int32 manualVideoConsumptionNumber = 86; // 已用手动扩展视频数
|
||||||
int32 manualImageConsumptionNumber = 86; // 已用手动扩展图文数
|
int32 manualImageConsumptionNumber = 87; // 已用手动扩展图文数
|
||||||
int32 manualDataAnalysisConsumptionNumber = 87; // 已用手动扩展数据数
|
int32 manualDataAnalysisConsumptionNumber = 88; // 已用手动扩展数据数
|
||||||
int32 manualCompetitiveConsumptionNumber = 88; // 已用手动扩展竞品数
|
int32 manualCompetitiveConsumptionNumber = 89; // 已用手动扩展竞品数
|
||||||
int32 manualAccountNumber = 89; // 可用手动扩展账号数
|
int32 manualAccountNumber = 90; // 可用手动扩展账号数
|
||||||
int32 manualVideoNumber = 90; // 可用手动扩展视频数
|
int32 manualVideoNumber = 91; // 可用手动扩展视频数
|
||||||
int32 manualImageNumber = 91; // 可用手动扩展图文数
|
int32 manualImageNumber = 92; // 可用手动扩展图文数
|
||||||
int32 manualDataAnalysisNumber = 92; // 可用手动扩展数据数
|
int32 manualDataAnalysisNumber = 93; // 可用手动扩展数据数
|
||||||
int32 manualCompetitiveNumber = 93; // 可用手动扩展竞品数
|
int32 manualCompetitiveNumber = 94; // 可用手动扩展竞品数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1027,6 +1079,7 @@ message BundleBalanceExportReq{
|
|||||||
uint64 expiredTimeStart = 3;
|
uint64 expiredTimeStart = 3;
|
||||||
uint64 expiredTimeEnd = 4;
|
uint64 expiredTimeEnd = 4;
|
||||||
uint32 status = 5;
|
uint32 status = 5;
|
||||||
|
uint32 bundleType = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BundleBalanceExportResp{
|
message BundleBalanceExportResp{
|
||||||
@ -1034,12 +1087,18 @@ message BundleBalanceExportResp{
|
|||||||
repeated BundleBalanceExportItem data =2;
|
repeated BundleBalanceExportItem data =2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message PayLaterBundleBalanceExportResp{
|
||||||
|
int64 total = 1;
|
||||||
|
repeated PayLaterBundleBalanceItem data =2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
message GetBundleBalanceListResp{
|
message GetBundleBalanceListResp{
|
||||||
int64 total = 1;
|
int64 total = 1;
|
||||||
repeated BundleBalanceItem data = 2;
|
repeated BundleBalanceItem data = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message CreateBundleBalanceReq{
|
message CreateBundleBalanceReq{
|
||||||
int32 userId = 1;
|
int32 userId = 1;
|
||||||
string orderUUID = 2;
|
string orderUUID = 2;
|
||||||
@ -1091,6 +1150,7 @@ message GetUsedRecordListReq{
|
|||||||
int32 page = 9;
|
int32 page = 9;
|
||||||
int32 pageSize = 10;
|
int32 pageSize = 10;
|
||||||
int32 costType = 11;
|
int32 costType = 11;
|
||||||
|
int32 bundleType = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetUsedRecordListResp {
|
message GetUsedRecordListResp {
|
||||||
@ -1171,6 +1231,7 @@ message ToBeComfirmedWorksResp{
|
|||||||
|
|
||||||
message GetBundleBalanceByUserIdReq{
|
message GetBundleBalanceByUserIdReq{
|
||||||
int32 userId = 1;
|
int32 userId = 1;
|
||||||
|
string orderUUID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBundleBalanceByUserIdResp{
|
message GetBundleBalanceByUserIdResp{
|
||||||
@ -1212,6 +1273,20 @@ message GetBundleBalanceByUserIdResp{
|
|||||||
string renewalOrderUuid = 36;
|
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{
|
message GetBundleBalanceByOrderUUIDReq{
|
||||||
string orderUUID = 1;
|
string orderUUID = 1;
|
||||||
}
|
}
|
||||||
@ -1705,6 +1780,7 @@ message ArtistBundleBalanceResponse {
|
|||||||
message SetBundleBalanceLayoutReq{
|
message SetBundleBalanceLayoutReq{
|
||||||
uint32 userId = 1;
|
uint32 userId = 1;
|
||||||
string data = 2;
|
string data = 2;
|
||||||
|
int32 bundleType = 3; // 1: 普通套餐类型 2: 先用后付套餐
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetBundleBalanceLayoutResp{
|
message SetBundleBalanceLayoutResp{
|
||||||
@ -1713,6 +1789,7 @@ message SetBundleBalanceLayoutResp{
|
|||||||
|
|
||||||
message GetBundleBalanceLayoutReq{
|
message GetBundleBalanceLayoutReq{
|
||||||
uint32 userId = 1;
|
uint32 userId = 1;
|
||||||
|
int32 bundleType = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBundleBalanceLayoutResp{
|
message GetBundleBalanceLayoutResp{
|
||||||
|
|||||||
10975
pb/bundle/bundle.pb.go
10975
pb/bundle/bundle.pb.go
File diff suppressed because it is too large
Load Diff
@ -399,6 +399,22 @@ func (this *BundleExtendRecordItem) Validate() error {
|
|||||||
func (this *GetBundleBalanceListReq) Validate() error {
|
func (this *GetBundleBalanceListReq) Validate() error {
|
||||||
return nil
|
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 {
|
func (this *GetBundleBalanceReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -421,6 +437,16 @@ func (this *BundleBalanceExportResp) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
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 {
|
func (this *GetBundleBalanceListResp) Validate() error {
|
||||||
for _, item := range this.Data {
|
for _, item := range this.Data {
|
||||||
if item != nil {
|
if item != nil {
|
||||||
@ -493,6 +519,22 @@ func (this *GetBundleBalanceByUserIdReq) Validate() error {
|
|||||||
func (this *GetBundleBalanceByUserIdResp) Validate() error {
|
func (this *GetBundleBalanceByUserIdResp) Validate() error {
|
||||||
return nil
|
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 {
|
func (this *GetBundleBalanceByOrderUUIDReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,12 +69,15 @@ type BundleClient interface {
|
|||||||
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||||
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, 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)
|
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)
|
GetBundleBalanceByOrderUUID func(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||||
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
BundleActivate func(ctx context.Context, in *BundleActivateReq) (*BundleActivateResp, error)
|
BundleActivate func(ctx context.Context, in *BundleActivateReq) (*BundleActivateResp, error)
|
||||||
BundleBalanceExport func(ctx context.Context, in *BundleBalanceExportReq) (*BundleBalanceExportResp, 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)
|
GetBundleBalanceLayout func(ctx context.Context, in *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
|
||||||
SetBundleBalanceLayout func(ctx context.Context, in *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
|
SetBundleBalanceLayout func(ctx context.Context, in *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, error)
|
||||||
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, 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)
|
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) {
|
func (c *bundleClient) GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetBundleBalanceByUserIdResp)
|
out := new(GetBundleBalanceByUserIdResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceByUserId", in, out)
|
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) {
|
func (c *bundleClient) GetBundleBalanceByOrderUUID(ctx context.Context, in *GetBundleBalanceByOrderUUIDReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByOrderUUIDResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetBundleBalanceByOrderUUIDResp)
|
out := new(GetBundleBalanceByOrderUUIDResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
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)
|
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) {
|
func (c *bundleClient) GetBundleBalanceLayout(ctx context.Context, in *GetBundleBalanceLayoutReq, opts ...grpc_go.CallOption) (*GetBundleBalanceLayoutResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetBundleBalanceLayoutResp)
|
out := new(GetBundleBalanceLayoutResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -1003,12 +1027,15 @@ type BundleServer interface {
|
|||||||
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
|
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||||
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||||
|
GetPayLaterBundleBalanceList(context.Context, *GetPayLaterBundleBalanceListReq) (*GetPayLaterBundleBalanceListResp, error)
|
||||||
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
||||||
|
GetBundleOrderListByUserId(context.Context, *GetBundleOrderListByUserIdReq) (*GetBundleOrderListByUserIdResp, error)
|
||||||
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error)
|
||||||
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
BundleActivate(context.Context, *BundleActivateReq) (*BundleActivateResp, error)
|
BundleActivate(context.Context, *BundleActivateReq) (*BundleActivateResp, error)
|
||||||
BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
|
BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error)
|
||||||
|
PayLaterBundleBalanceExport(context.Context, *BundleBalanceExportReq) (*PayLaterBundleBalanceExportResp, error)
|
||||||
GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
|
GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error)
|
||||||
SetBundleBalanceLayout(context.Context, *SetBundleBalanceLayoutReq) (*SetBundleBalanceLayoutResp, 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) {
|
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
|
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) {
|
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
|
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) {
|
func (UnimplementedBundleServer) GetBundleBalanceByOrderUUID(context.Context, *GetBundleBalanceByOrderUUIDReq) (*GetBundleBalanceByOrderUUIDResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByOrderUUID not implemented")
|
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) {
|
func (UnimplementedBundleServer) BundleBalanceExport(context.Context, *BundleBalanceExportReq) (*BundleBalanceExportResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BundleBalanceExport not implemented")
|
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) {
|
func (UnimplementedBundleServer) GetBundleBalanceLayout(context.Context, *GetBundleBalanceLayoutReq) (*GetBundleBalanceLayoutResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceLayout not implemented")
|
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)
|
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) {
|
func _Bundle_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetBundleBalanceByUserIdReq)
|
in := new(GetBundleBalanceByUserIdReq)
|
||||||
if err := dec(in); err != nil {
|
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)
|
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) {
|
func _Bundle_GetBundleBalanceByOrderUUID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetBundleBalanceByOrderUUIDReq)
|
in := new(GetBundleBalanceByOrderUUIDReq)
|
||||||
if err := dec(in); err != nil {
|
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)
|
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) {
|
func _Bundle_GetBundleBalanceLayout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetBundleBalanceLayoutReq)
|
in := new(GetBundleBalanceLayoutReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -4866,10 +4989,18 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "GetBundleBalanceList",
|
MethodName: "GetBundleBalanceList",
|
||||||
Handler: _Bundle_GetBundleBalanceList_Handler,
|
Handler: _Bundle_GetBundleBalanceList_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetPayLaterBundleBalanceList",
|
||||||
|
Handler: _Bundle_GetPayLaterBundleBalanceList_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBundleBalanceByUserId",
|
MethodName: "GetBundleBalanceByUserId",
|
||||||
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetBundleOrderListByUserId",
|
||||||
|
Handler: _Bundle_GetBundleOrderListByUserId_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBundleBalanceByOrderUUID",
|
MethodName: "GetBundleBalanceByOrderUUID",
|
||||||
Handler: _Bundle_GetBundleBalanceByOrderUUID_Handler,
|
Handler: _Bundle_GetBundleBalanceByOrderUUID_Handler,
|
||||||
@ -4890,6 +5021,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "BundleBalanceExport",
|
MethodName: "BundleBalanceExport",
|
||||||
Handler: _Bundle_BundleBalanceExport_Handler,
|
Handler: _Bundle_BundleBalanceExport_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "PayLaterBundleBalanceExport",
|
||||||
|
Handler: _Bundle_PayLaterBundleBalanceExport_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBundleBalanceLayout",
|
MethodName: "GetBundleBalanceLayout",
|
||||||
Handler: _Bundle_GetBundleBalanceLayout_Handler,
|
Handler: _Bundle_GetBundleBalanceLayout_Handler,
|
||||||
|
|||||||
@ -119,6 +119,7 @@ const (
|
|||||||
DataReportService = 3 //数据报表
|
DataReportService = 3 //数据报表
|
||||||
AccountService = 4 //账号数
|
AccountService = 4 //账号数
|
||||||
AvailableTimeService = 5 //可用时长
|
AvailableTimeService = 5 //可用时长
|
||||||
|
CompetitiveService = 6 //竞品数
|
||||||
)
|
)
|
||||||
|
|
||||||
// 套餐状态
|
// 套餐状态
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user