Compare commits
19 Commits
feat-hjj-B
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0bfd322a8 | ||
|
|
e9bef82968 | ||
|
|
aae7aa077b | ||
|
|
61e5a69484 | ||
|
|
0524d503f3 | ||
|
|
36a751b8ac | ||
|
|
7f5384c935 | ||
|
|
137e752c1b | ||
| 8b85aeee28 | |||
| bbe0c0390c | |||
|
|
7ac61c197c | ||
|
|
e5baa91e9d | ||
| 3584a9f948 | |||
| fc25533193 | |||
| 71f7be5716 | |||
| 55a5ba3152 | |||
| 185e5da57a | |||
| d730106309 | |||
| bfaac2fd95 |
@ -135,11 +135,11 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
}
|
||||
}
|
||||
}
|
||||
if req.Month == "" {
|
||||
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 = bb.user_id", newestMonthQuery).Where("")
|
||||
} else {
|
||||
session = session.Where("bb.month = ?", req.Month)
|
||||
session = session.Where("bb.month in (?)", req.Month)
|
||||
}
|
||||
err = session.Count(&total).Error
|
||||
if err != nil {
|
||||
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/app"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/duke-git/lancet/v2/datetime"
|
||||
@ -38,7 +39,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
||||
// }
|
||||
err = query.First(result).Error
|
||||
if err != nil {
|
||||
return
|
||||
return nil, fmt.Errorf("总金额统计失败")
|
||||
}
|
||||
|
||||
// 将字符串转换为数值进行计算
|
||||
@ -72,7 +73,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
||||
|
||||
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
||||
Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no = bundle_order_on").
|
||||
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
|
||||
Where("`reconciliation`.pay_time >= ?", req.Start+" 00:00:00").
|
||||
Where("`reconciliation`.pay_time <= ?", req.End+" 23:59:59").
|
||||
Where("`reconciliation`.deleted_at is null and reconciliation.pay_status = 2 and bor.status=2 and bor.deleted_at is null")
|
||||
@ -1316,22 +1317,38 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
||||
var start time.Time
|
||||
var end time.Time
|
||||
var err error
|
||||
if req.Month != "" {
|
||||
t, err := time.Parse("2006-01", req.Month)
|
||||
|
||||
subQuery := app.ModuleClients.BundleDB.Table("cast_media_account").
|
||||
Select("artist_uuid,any_value(artist_name) as artist_name,any_value(created_at) as created_at").
|
||||
Group("artist_uuid").
|
||||
Where("deleted_at = 0 and expired != 2")
|
||||
//如果选择了月份
|
||||
if len(req.Month) > 0 {
|
||||
// 构建多个月份的时间范围条件(使用 OR 连接)
|
||||
var conditions []string
|
||||
var args []interface{}
|
||||
for _, month := range req.Month {
|
||||
t, err := time.Parse("2006-01", month)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
start = datetime.BeginOfMonth(t)
|
||||
end = datetime.EndOfMonth(t)
|
||||
// 为每个月添加时间范围条件
|
||||
conditions = append(conditions, "(created_at >= ? AND created_at <= ?)")
|
||||
args = append(args, start.Unix(), end.Unix())
|
||||
}
|
||||
// 使用 OR 连接所有月份条件
|
||||
if len(conditions) > 0 {
|
||||
subQuery = subQuery.Where(strings.Join(conditions, " OR "), args...)
|
||||
}
|
||||
} else {
|
||||
start = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC) // Unix 时间戳起始时间
|
||||
end = time.Date(2099, 12, 31, 23, 59, 59, 0, time.UTC) // 设置一个很远的未来日期
|
||||
subQuery = subQuery.Where("created_at >= ?", start.Unix()).
|
||||
Where("created_at <= ?", end.Unix())
|
||||
}
|
||||
subQuery := app.ModuleClients.BundleDB.Table("cast_media_account").
|
||||
Select("artist_uuid,any_value(artist_name) as artist_name,any_value(created_at) as created_at").
|
||||
Group("artist_uuid").
|
||||
Where("created_at >= ?", start.Unix()).Where("created_at <= ?", end.Unix()).
|
||||
Where("deleted_at = 0")
|
||||
|
||||
query := app.ModuleClients.BundleDB.Table("( ? ) cma", subQuery).
|
||||
Select(`tiktok.platform_user_id as tiktok_account,
|
||||
tiktok.platform_user_name as tiktok_nickname,
|
||||
@ -1342,20 +1359,27 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
||||
ins.platform_user_id as instagram_account,
|
||||
ins.platform_user_name as instagram_nickname,
|
||||
ins_auth.auth_status as ins_auth_status,
|
||||
youtube.platform_user_id as youtube_account,
|
||||
youtube.platform_user_name as youtube_nickname,
|
||||
youtube_auth.auth_status as youtube_auth_status,
|
||||
bluesky.platform_user_id as bluesky_account,
|
||||
bluesky.platform_user_name as bluesky_nickname,
|
||||
bluesky_auth.auth_status as bluesky_auth_status,
|
||||
cma.artist_name,
|
||||
bor.customer_num as user_num
|
||||
`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 1 and deleted_at = 0) tiktok on tiktok.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 1 and deleted_at = 0 and expired != 2) tiktok on tiktok.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (Select * from cast_media_auth where platform_id = 1 and deleted_at = 0 ) tiktok_auth on tiktok_auth.user_id = tiktok.user_id`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 4 and deleted_at = 0) dm on dm.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 4 and deleted_at = 0 and expired != 2) dm on dm.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (Select * from cast_media_auth where platform_id = 4 and deleted_at = 0) dm_auth on dm_auth.user_id = dm.user_id`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 3 and deleted_at = 0) ins on ins.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (SELECT * FROM cast_media_account where platform_id = 3 and deleted_at = 0 and expired != 2) ins on ins.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (Select * from cast_media_auth where platform_id = 3 and deleted_at = 0) ins_auth on ins_auth.user_id = ins.user_id`).
|
||||
Joins(`left join (Select * from cast_media_account where platform_id = 2 and deleted_at = 0 and expired != 2) youtube on youtube.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (Select * from cast_media_auth where platform_id = 2 and deleted_at = 0) youtube_auth on youtube_auth.user_id = youtube.user_id`).
|
||||
Joins(`left join (Select * from cast_media_account where platform_id = 5 and deleted_at = 0 and expired != 2) bluesky on bluesky.artist_uuid = cma.artist_uuid`).
|
||||
Joins(`left join (Select * from cast_media_auth where platform_id = 5 and deleted_at = 0) bluesky_auth on bluesky_auth.user_id = bluesky.user_id`).
|
||||
Joins(`left join bundle_order_records bor on bor.customer_id COLLATE utf8mb4_general_ci= cma.artist_uuid COLLATE utf8mb4_general_ci`).
|
||||
Where("bor.deleted_at is null")
|
||||
if req.Month != "" {
|
||||
query = query.Where("cma.created_at >= ?", start.Unix()).Where("cma.created_at <= ?", end.Unix())
|
||||
}
|
||||
err = query.Find(&data.Data).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -1366,7 +1390,7 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
||||
func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *bundle.MetricsVideoSubmitExportResp, err error) {
|
||||
result = &bundle.MetricsVideoSubmitExportResp{}
|
||||
var query *gorm.DB
|
||||
if req.Month == "" {
|
||||
if len(req.Month) == 0 {
|
||||
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
||||
Select(`cw.artist_name ,
|
||||
cw.title as video_title,
|
||||
@ -1381,22 +1405,61 @@ func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *
|
||||
Where("(tiktok.created_at is not null or dm.created_at is not null or ins.created_at is not null) and cw.deleted_at = 0 and bor.deleted_at is null and cw.origin_uuid = ''").
|
||||
Order("cw.artist_name")
|
||||
} else {
|
||||
// 构建多个月份的时间范围参数
|
||||
var timeRanges []struct {
|
||||
Start int64
|
||||
End int64
|
||||
}
|
||||
|
||||
t, err := time.Parse("2006-01", req.Month)
|
||||
for _, month := range req.Month {
|
||||
t, err := time.Parse("2006-01", month)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
start := datetime.BeginOfMonth(t)
|
||||
end := datetime.EndOfMonth(t)
|
||||
timeRanges = append(timeRanges, struct {
|
||||
Start int64
|
||||
End int64
|
||||
}{Start: start.Unix(), End: end.Unix()})
|
||||
}
|
||||
// 构建时间筛选 SQL 条件的辅助函数
|
||||
buildTimeFilterSQL := func(tableAlias string) (string, []interface{}) {
|
||||
if len(timeRanges) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
var conditions []string
|
||||
var args []interface{}
|
||||
for _, tr := range timeRanges {
|
||||
// 明确指定表别名,避免字段歧义
|
||||
conditions = append(conditions, fmt.Sprintf("(%s.created_at >= ? AND %s.created_at <= ?)", tableAlias, tableAlias))
|
||||
args = append(args, tr.Start, tr.End)
|
||||
}
|
||||
return "(" + strings.Join(conditions, " OR ") + ")", args
|
||||
}
|
||||
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
||||
Select(`cw.artist_name, cw.title AS video_title, tiktok.created_at AS tiktok_upload_time, dm.created_at AS dm_upload_time, ins.created_at AS instagram_upload_time, bor.customer_num AS user_num`).
|
||||
Joins(`LEFT JOIN cast_work_platform_info tiktok ON tiktok.work_uuid = cw.uuid AND tiktok.platform_id = 1 AND tiktok.created_at >= ? AND tiktok.created_at <= ?`, start.Unix(), end.Unix()).
|
||||
Joins(`LEFT JOIN cast_work_platform_info dm ON dm.work_uuid = cw.uuid AND dm.platform_id = 4 AND dm.created_at >= ? AND dm.created_at <= ?`, start.Unix(), end.Unix()).
|
||||
Joins(`LEFT JOIN cast_work_platform_info ins ON ins.work_uuid = cw.uuid AND ins.platform_id = 3 AND ins.created_at >= ? AND ins.created_at <= ?`, start.Unix(), end.Unix()).
|
||||
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.origin_uuid = '' and 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)`).
|
||||
Order("cw.artist_name")
|
||||
Select(`cw.artist_name, cw.title AS video_title, tiktok.created_at AS tiktok_upload_time, dm.created_at AS dm_upload_time, ins.created_at AS instagram_upload_time, bor.customer_num AS user_num`)
|
||||
|
||||
// 为每个平台添加时间筛选条件
|
||||
if len(timeRanges) > 0 {
|
||||
// TikTok JOIN
|
||||
tiktokTimeSQL, tiktokArgs := buildTimeFilterSQL("tiktok")
|
||||
joinSQL := `LEFT JOIN cast_work_platform_info tiktok ON tiktok.work_uuid = cw.uuid AND tiktok.platform_id = 1 AND ` + tiktokTimeSQL
|
||||
query = query.Joins(joinSQL, tiktokArgs...)
|
||||
|
||||
// DM JOIN
|
||||
dmTimeSQL, dmArgs := buildTimeFilterSQL("dm")
|
||||
joinSQL = `LEFT JOIN cast_work_platform_info dm ON dm.work_uuid = cw.uuid AND dm.platform_id = 4 AND ` + dmTimeSQL
|
||||
query = query.Joins(joinSQL, dmArgs...)
|
||||
|
||||
// Instagram JOIN
|
||||
insTimeSQL, insArgs := buildTimeFilterSQL("ins")
|
||||
joinSQL = `LEFT JOIN cast_work_platform_info ins ON ins.work_uuid = cw.uuid AND ins.platform_id = 3 AND ` + insTimeSQL
|
||||
query = query.Joins(joinSQL, insArgs...)
|
||||
}
|
||||
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)`).
|
||||
Order("cw.artist_name")
|
||||
}
|
||||
err = query.Find(&result.Data).Error
|
||||
return
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/shopspring/decimal"
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/app"
|
||||
@ -127,6 +128,26 @@ func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bun
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tempRecord := new(model.BundleOrderRecords)
|
||||
if err := app.ModuleClients.BundleDB.Where("deleted_at is null and order_no = ?", orderRecord.OrderNo).First(&tempRecord).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, errors.New("订单记录不存在")
|
||||
}
|
||||
return nil, fmt.Errorf("查询订单失败: %v", err)
|
||||
}
|
||||
if orderRecord.Status == 2 && tempRecord.AmountType == 2 && tempRecord.TotalAmount > 0 {
|
||||
// 当回调支付成功,币种是美元,且订单金额大于0,计算美元手续费:订单金额*0.019(四舍五入保留两位小数字)+0.1
|
||||
amount := decimal.NewFromFloat32(tempRecord.TotalAmount)
|
||||
rate, _ := decimal.NewFromString("0.019")
|
||||
fee := amount.Mul(rate)
|
||||
// 4. 四舍五入保留两位小数
|
||||
feeRounded := fee.Round(2)
|
||||
addition, _ := decimal.NewFromString("0.1")
|
||||
result := feeRounded.Add(addition)
|
||||
valueAdd.HandlingFee = result.String()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||
@ -518,6 +539,7 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
||||
Amount: record.Amount,
|
||||
CustomerId: customerID,
|
||||
PayTime: record.PayTime,
|
||||
InviterId: record.InviterID,
|
||||
}
|
||||
|
||||
// 聚合子订单
|
||||
@ -807,6 +829,19 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
|
||||
PayStatus: int(req.PaymentStatus),
|
||||
SerialNumber: req.SerialNumber,
|
||||
}
|
||||
|
||||
if req.PaymentStatus == 2 && existing.CurrencyType == 2 && existing.PayAmount > 0 {
|
||||
// 当回调支付成功,币种是美元,且订单金额大于0,计算美元手续费:订单金额*0.019(四舍五入保留两位小数字)+0.1
|
||||
amount := decimal.NewFromFloat32(existing.PayAmount)
|
||||
rate, _ := decimal.NewFromString("0.019")
|
||||
fee := amount.Mul(rate)
|
||||
// 4. 四舍五入保留两位小数
|
||||
feeRounded := fee.Round(2)
|
||||
addition, _ := decimal.NewFromString("0.1")
|
||||
result := feeRounded.Add(addition)
|
||||
updates.HandlingFee = result.String()
|
||||
}
|
||||
|
||||
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
||||
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
||||
}
|
||||
|
||||
@ -464,9 +464,9 @@ active_windows AS (
|
||||
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
|
||||
rn.name AS user_name
|
||||
FROM ` + "`micro-account`.`user`" + ` u
|
||||
INNER JOIN ` + "`micro-account`.real_name" + ` rn ON rn.id = u.real_name_id AND rn.name IS NOT NULL
|
||||
INNER JOIN ` + "`micro-account`.real_name" + ` rn ON rn.id = u.real_name_id AND rn.name IS NOT NULL AND rn.deleted_at = 0
|
||||
INNER JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2
|
||||
INNER JOIN latest_bor bor ON bor.customer_id = u.id
|
||||
INNER JOIN latest_bor bor ON bor.customer_id = u.id AND u.deleted_at = 0
|
||||
INNER JOIN newest_month nm ON nm.user_id = u.id
|
||||
INNER JOIN bundle_balance bb ON bb.user_id = u.id AND bb.order_uuid = bor.uuid AND bb.month = nm.month AND bb.deleted_at IS NULL
|
||||
WHERE u.deleted_at = 0
|
||||
@ -527,25 +527,25 @@ balance_sum AS (
|
||||
GROUP BY bb2.user_id
|
||||
),
|
||||
|
||||
-- 6. 作品统计
|
||||
-- 6. 作品统计(只统计 origin_uuid 为空的作品)
|
||||
cw_agg AS (
|
||||
SELECT
|
||||
aw.user_id,
|
||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_video_count,
|
||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_post_count,
|
||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.cost = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_video_consumed,
|
||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.cost = 1 AND cw.deleted_at = 0 AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_post_consumed
|
||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_video_count,
|
||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS uploaded_post_count,
|
||||
COUNT(CASE WHEN cw.work_category = 2 AND cw.cost = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_video_consumed,
|
||||
COUNT(CASE WHEN cw.work_category = 1 AND cw.cost = 1 AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN aw.start_at AND aw.expired_at THEN 1 END) AS released_post_consumed
|
||||
FROM active_windows aw
|
||||
LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
||||
GROUP BY aw.user_id
|
||||
),
|
||||
|
||||
-- 7. 数据分析作品统计
|
||||
-- 7. 数据分析作品统计(排除 work_analysis_status = 1 的数据分析)
|
||||
cwa_agg AS (
|
||||
SELECT
|
||||
aw.user_id,
|
||||
COUNT(CASE WHEN cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS uploaded_data_count,
|
||||
COUNT(CASE WHEN cwa.cost = 1 AND cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS released_data_consumed
|
||||
COUNT(CASE WHEN cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS uploaded_data_count,
|
||||
COUNT(CASE WHEN cwa.cost = 1 AND cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(aw.start_at) AND UNIX_TIMESTAMP(aw.expired_at) THEN 1 END) AS released_data_consumed
|
||||
FROM active_windows aw
|
||||
LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
||||
GROUP BY aw.user_id
|
||||
@ -810,49 +810,49 @@ func GetPendingUploadBreakdownBySubNums(subNums []string, page int, pageSize int
|
||||
" FROM cast_work cwv\n" +
|
||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
||||
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_video_count,\n" +
|
||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND (cwv.origin_uuid = '' OR cwv.origin_uuid IS NULL) AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_video_count,\n" +
|
||||
" ((COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
||||
" COALESCE((\n" +
|
||||
" SELECT COUNT(DISTINCT cwv.uuid)\n" +
|
||||
" FROM cast_work cwv\n" +
|
||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\n" +
|
||||
" WHERE cwv.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_video_count,\n" +
|
||||
" AND cwv.deleted_at = 0 AND cwv.work_category = 2 AND cwv.cost = 1 AND (cwv.origin_uuid = '' OR cwv.origin_uuid IS NULL) AND cwv.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwev.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 2 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_video_count,\n" +
|
||||
" (COALESCE(lbb.total_bundle_image, 0) - COALESCE((\n" +
|
||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||
" FROM cast_work cwp\n" +
|
||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
||||
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_post_count,\n" +
|
||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND (cwp.origin_uuid = '' OR cwp.origin_uuid IS NULL) AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 1 THEN cw.uuid END), 0) AS pending_bundle_post_count,\n" +
|
||||
" ((COALESCE(lbb.total_increase_image, 0) + bb.manual_image_number - bb.manual_image_consumption_number) -\n" +
|
||||
" COALESCE((\n" +
|
||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||
" FROM cast_work cwp\n" +
|
||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\n" +
|
||||
" WHERE cwp.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_post_count,\n" +
|
||||
" AND cwp.deleted_at = 0 AND cwp.work_category = 1 AND cwp.cost = 1 AND (cwp.origin_uuid = '' OR cwp.origin_uuid IS NULL) AND cwp.submit_time BETWEEN bb.start_at AND bb.expired_at AND cwep.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cw.work_category = 1 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cwe.cost_type = 2 THEN cw.uuid END), 0)) AS pending_increase_post_count,\n" +
|
||||
" (COALESCE(lbb.total_bundle_data, 0) - COALESCE((\n" +
|
||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||
" FROM cast_work_analysis ca\n" +
|
||||
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
||||
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN cwae.cost_type = 1 THEN cwa.uuid END), 0) AS pending_bundle_data_count,\n" +
|
||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND (ca.work_analysis_status IS NULL OR ca.work_analysis_status != 1) AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 1\n" +
|
||||
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwae.cost_type = 1 THEN cwa.uuid END), 0) AS pending_bundle_data_count,\n" +
|
||||
" ((COALESCE(lbb.total_increase_data, 0) + bb.manual_data_analysis_number - bb.manual_data_analysis_consumption_number) -\n" +
|
||||
" COALESCE((\n" +
|
||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||
" FROM cast_work_analysis ca\n" +
|
||||
" JOIN cast_work_analysis_extra cae ON cae.analysis_uuid = ca.uuid AND cae.deleted_at = 0\n" +
|
||||
" WHERE ca.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci\n" +
|
||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cwae.cost_type = 2 THEN cwa.uuid END), 0)) AS pending_increase_data_count,\n" +
|
||||
" AND ca.deleted_at = 0 AND ca.cost = 1 AND (ca.work_analysis_status IS NULL OR ca.work_analysis_status != 1) AND ca.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at) AND cae.cost_type = 2\n" +
|
||||
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwae.cost_type = 2 THEN cwa.uuid END), 0)) AS pending_increase_data_count,\n" +
|
||||
" GREATEST(\n" +
|
||||
" (COALESCE(lbb.total_bundle_video, 0) + COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
||||
" COALESCE((SELECT COUNT(1) FROM cast_work cw2 WHERE cw2.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw2.deleted_at = 0 AND cw2.work_category = 2 AND cw2.cost = 1 AND cw2.submit_time BETWEEN bb.start_at AND bb.expired_at), 0),\n" +
|
||||
" COALESCE((SELECT COUNT(1) FROM cast_work cw2 WHERE cw2.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw2.deleted_at = 0 AND cw2.work_category = 2 AND cw2.cost = 1 AND (cw2.origin_uuid = '' OR cw2.origin_uuid IS NULL) AND cw2.submit_time BETWEEN bb.start_at AND bb.expired_at), 0),\n" +
|
||||
" 0) -\n" +
|
||||
" (SELECT COUNT(1) FROM cast_video_script cvs WHERE CAST(u.id AS CHAR) COLLATE utf8mb4_general_ci = cvs.artist_uuid COLLATE utf8mb4_general_ci AND cvs.deleted_at = 0 AND cvs.created_at BETWEEN UNIX_TIMESTAMP(CONVERT_TZ(bb.start_at, '+00:00', '+00:00')) AND UNIX_TIMESTAMP(CONVERT_TZ(bb.expired_at, '+00:00', '+00:00'))) AS pending_video_script_count\n" +
|
||||
"FROM\n" +
|
||||
@ -861,16 +861,16 @@ func GetPendingUploadBreakdownBySubNums(subNums []string, page int, pageSize int
|
||||
" (SELECT customer_id, MAX(created_at) AS max_created_time FROM bundle_order_records WHERE status = 2 AND deleted_at IS NULL GROUP BY customer_id) AS bor2\n" +
|
||||
" ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time\n" +
|
||||
"JOIN `micro-account`.user u ON u.id = bor1.customer_id AND u.deleted_at = 0\n" +
|
||||
"JOIN `micro-account`.real_name rn ON rn.id = u.real_name_id\n" +
|
||||
"JOIN `micro-account`.real_name rn ON rn.id = u.real_name_id AND rn.deleted_at = 0\n" +
|
||||
"JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2\n" +
|
||||
"JOIN bundle_balance bb ON bb.order_uuid COLLATE utf8mb4_general_ci = bor1.uuid COLLATE utf8mb4_general_ci AND bb.user_id = u.id\n" +
|
||||
"JOIN bundle_balance bb ON bb.order_uuid COLLATE utf8mb4_general_ci = bor1.uuid COLLATE utf8mb4_general_ci AND bb.user_id = u.id AND u.deleted_at = 0\n" +
|
||||
"JOIN\n" +
|
||||
" (SELECT user_id, MAX(month) AS month FROM bundle_balance WHERE deleted_at IS NULL GROUP BY user_id) AS newest_month\n" +
|
||||
" ON bb.user_id = newest_month.user_id AND CAST(bb.month AS CHAR) COLLATE utf8mb4_general_ci = CAST(newest_month.month AS CHAR) COLLATE utf8mb4_general_ci\n" +
|
||||
"LEFT JOIN latest_bundle_balance lbb ON lbb.user_id = u.id\n" +
|
||||
"LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw.deleted_at = 0 AND cw.submit_time BETWEEN bb.start_at AND bb.expired_at\n" +
|
||||
"LEFT JOIN latest_bundle_balance lbb ON lbb.user_id = u.id AND u.deleted_at = 0\n" +
|
||||
"LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cw.deleted_at = 0 AND (cw.origin_uuid = '' OR cw.origin_uuid IS NULL) AND cw.submit_time BETWEEN bb.start_at AND bb.expired_at\n" +
|
||||
"LEFT JOIN cast_work_extra cwe ON cwe.work_uuid = cw.uuid AND cwe.deleted_at = 0\n" +
|
||||
"LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cwa.deleted_at = 0 AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at)\n" +
|
||||
"LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = u.tel_num COLLATE utf8mb4_general_ci AND cwa.deleted_at = 0 AND (cwa.work_analysis_status IS NULL OR cwa.work_analysis_status != 1) AND cwa.submit_time BETWEEN UNIX_TIMESTAMP(bb.start_at) AND UNIX_TIMESTAMP(bb.expired_at)\n" +
|
||||
"LEFT JOIN cast_work_analysis_extra cwae ON cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0\n" +
|
||||
"WHERE bor1.deleted_at IS NULL AND bor1.status = 2 AND DATE_ADD(UTC_TIMESTAMP(), INTERVAL 8 HOUR) BETWEEN bb.start_at AND bb.expired_at AND bor1.customer_num IN ?\n" +
|
||||
"GROUP BY u.id, rn.name, u.tel_num, bor1.customer_num, bb.start_at, bb.expired_at, bb.manual_video_number, bb.manual_video_consumption_number, bb.manual_image_number, bb.manual_image_consumption_number, bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number, lbb.total_bundle_video, lbb.total_increase_video, lbb.total_bundle_image, lbb.total_increase_image, lbb.total_bundle_data, lbb.total_increase_data\n"
|
||||
|
||||
@ -16,6 +16,7 @@ import (
|
||||
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/samber/lo"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
|
||||
@ -282,7 +283,7 @@ func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBund
|
||||
data.ExpiredAt = time.Now()
|
||||
userId, err := strconv.Atoi(addValues[0].CustomerID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.New("获取用户ID失败")
|
||||
}
|
||||
data.Month = time.Now().Format("2006-01")
|
||||
data.UserId = userId
|
||||
@ -501,11 +502,11 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
||||
PageSize: 99999,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.New("余量列表数据失败")
|
||||
}
|
||||
prefixData, err := dao.BalanceExportPrefix()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.New("获取前缀数据失败")
|
||||
}
|
||||
|
||||
var prefixMap = map[int32]model.BundleExportDto{}
|
||||
@ -544,6 +545,14 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
||||
} else {
|
||||
item.IncreaseVideoUnitPrice = float32(math.Round(float64(item.IncreaseAmount/float32(v.IncreaseVideoNumber))*100) / 100)
|
||||
}
|
||||
bundleUnitPrice := decimal.NewFromFloat32(item.BundleVideoUnitPrice)
|
||||
increaseUnitPrice := decimal.NewFromFloat32(item.IncreaseVideoUnitPrice)
|
||||
|
||||
bundlePriceTotal := bundleUnitPrice.Mul(decimal.NewFromInt32(v.MonthBundleVideoConsumptionNumber))
|
||||
increasePriceTotal := increaseUnitPrice.Mul(decimal.NewFromInt32(v.MonthIncreaseVideoConsumptionNumber))
|
||||
|
||||
item.MonthlyBundleVideoConsumptionPrice = bundlePriceTotal.StringFixed(2)
|
||||
item.MonthlyIncreaseVideoConsumptionPrice = increasePriceTotal.StringFixed(2)
|
||||
items = append(items, item)
|
||||
}
|
||||
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
||||
|
||||
@ -68,6 +68,8 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
|
||||
ExpirationTime: req.ExpirationTime,
|
||||
Language: req.Language,
|
||||
BundleOrderValueAdd: addRecords,
|
||||
PlatformIds: req.PlatformIds,
|
||||
InviterID: req.InviterId,
|
||||
}
|
||||
res, err = dao.CreateOrderRecord(orderRecord)
|
||||
return
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@ -42,6 +44,8 @@ type BundleOrderRecords struct {
|
||||
Language string `gorm:"column:language;comment:语言" json:"language"`
|
||||
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
|
||||
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
|
||||
PlatformIds PlatformIDs `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3 , DM = 4, BL = 5;" json:"platformIDs"`
|
||||
InviterID uint64 `gorm:"column:inviter_id;type:bigint;comment:邀请人ID" json:"inviterID"`
|
||||
}
|
||||
type BundleOrderValueAdd struct {
|
||||
gorm.Model
|
||||
@ -73,6 +77,30 @@ type BundleOrderValueAdd struct {
|
||||
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
||||
IsExpired bool `json:"isExpired" gorm:"column:is_expired;default:false;comment:是否过期作废 false:不作废 true:作废"`
|
||||
}
|
||||
type PlatformIDs []uint32
|
||||
|
||||
// 实现 Scanner 接口
|
||||
func (p *PlatformIDs) Scan(value interface{}) error {
|
||||
if value == nil {
|
||||
*p = []uint32{}
|
||||
return nil
|
||||
}
|
||||
|
||||
bytes, ok := value.([]byte)
|
||||
if !ok {
|
||||
return errors.New("type assertion to []byte failed")
|
||||
}
|
||||
|
||||
return json.Unmarshal(bytes, p)
|
||||
}
|
||||
|
||||
// 实现 Valuer 接口
|
||||
func (p PlatformIDs) Value() (driver.Value, error) {
|
||||
if len(p) == 0 {
|
||||
return "[]", nil
|
||||
}
|
||||
return json.Marshal(p)
|
||||
}
|
||||
|
||||
// 财务确认状态
|
||||
const (
|
||||
|
||||
@ -217,6 +217,8 @@ message OrderCreateRecord{
|
||||
int32 payType = 19 [json_name = "payType"];
|
||||
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
||||
string orderNo = 21 [json_name = "orderNo"];
|
||||
repeated uint32 platformIds = 22; // 发布平台ID集合 (json 格式字符串)
|
||||
uint64 inviterId = 23; // 邀请人ID
|
||||
}
|
||||
message OrderCreateAddRecord{
|
||||
int32 serviceType = 1 [json_name = "serviceType"];
|
||||
@ -269,6 +271,9 @@ message OrderBundleRecordInfo{
|
||||
int64 customerId = 9;
|
||||
string payTime = 10;
|
||||
string subNum = 11;
|
||||
uint64 inviterId = 12;
|
||||
string inviterCode = 13;
|
||||
string inviterName = 14;
|
||||
}
|
||||
message OrderAddBundleRecordInfo{
|
||||
string orderAddNo = 1;
|
||||
@ -726,7 +731,7 @@ message GetBundleBalanceListReq{
|
||||
int64 expiredTimeEnd = 8;
|
||||
int32 page = 9;
|
||||
int32 pageSize = 10;
|
||||
string month = 11;
|
||||
repeated string month = 11;
|
||||
int32 statusType = 12;
|
||||
}
|
||||
|
||||
@ -910,11 +915,15 @@ message BundleBalanceExportItem {
|
||||
int32 monthlyManualVideoConsumptionNumber = 65; // 当月手动扩展视频使用数
|
||||
int32 monthlyManualImageConsumptionNumber = 66; // 当月手动扩展图文使用数
|
||||
int32 monthlyManualDataAnalysisConsumptionNumber = 67; // 当月手动扩展数据分析使用数
|
||||
|
||||
//视频当月消耗金额
|
||||
string monthlyBundleVideoConsumptionPrice = 68;//当月套餐消耗总金额
|
||||
string monthlyIncreaseVideoConsumptionPrice = 69;//当月增值消耗总金额
|
||||
}
|
||||
|
||||
|
||||
message BundleBalanceExportReq{
|
||||
string month = 1;
|
||||
repeated string month = 1;
|
||||
string userName = 2;
|
||||
uint64 expiredTimeStart = 3;
|
||||
uint64 expiredTimeEnd = 4;
|
||||
@ -1761,7 +1770,7 @@ message MetricsBundlePurchaseItem{
|
||||
}
|
||||
|
||||
message MetricsArtistAccountExportReq{
|
||||
string month = 1;
|
||||
repeated string month = 1;
|
||||
}
|
||||
|
||||
message MetricsArtistAccountExportResp{
|
||||
@ -1774,20 +1783,24 @@ message MetricsArtistAccountExportItem{
|
||||
string dmAccount = 3;
|
||||
string dmNickname = 4;
|
||||
int32 dmAuthStatus = 5;
|
||||
// string youtubeAccount = 3; 现在没有YouTube了
|
||||
// string youtubeNickname = 4;
|
||||
string instagramAccount = 6;
|
||||
string instagramNickname = 7;
|
||||
int32 insAuthStatus = 8;
|
||||
string tiktokAccount = 9;
|
||||
string tiktokNickname = 10;
|
||||
int32 tiktokAuthStatus = 11;
|
||||
string youtubeAccount = 12;
|
||||
string youtubeNickname = 13;
|
||||
int32 youtubeAuthStatus = 14;
|
||||
string blueskyAccount = 15;
|
||||
string blueskyNickname = 16;
|
||||
int32 blueskyAuthStatus = 17;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message MetricsVideoSubmitExportReq{
|
||||
string month = 1;
|
||||
repeated string month = 1;
|
||||
}
|
||||
|
||||
message MetricsVideoSubmitExportResp{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.21.1
|
||||
// - protoc-gen-go-triple v1.0.5
|
||||
// - protoc v5.26.0
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
|
||||
@ -63,7 +63,16 @@ func loadMysqlConn(conn string) *gorm.DB {
|
||||
&model.BundleActivate{},
|
||||
&model.BundleBalanceLayout{},
|
||||
)
|
||||
|
||||
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "platform_ids") == false {
|
||||
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "platform_ids"); err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
if db.Migrator().HasColumn(&model.BundleOrderRecords{}, "inviter_id") == false {
|
||||
if err := db.Migrator().AddColumn(&model.BundleOrderRecords{}, "inviter_id"); err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
// return nil
|
||||
panic(err)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user