Compare commits
No commits in common. "main" and "feat-cjy-taskLog" have entirely different histories.
main
...
feat-cjy-t
@ -135,11 +135,11 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(req.Month) == 0 {
|
if req.Month == "" {
|
||||||
newestMonthQuery := app.ModuleClients.BundleDB.Model(&model.BundleBalance{}).Select("max(month) as month,user_id").Group("user_id")
|
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("")
|
session.Joins("LEFT JOIN (?) as newest_month on newest_month.user_id = bb.user_id", newestMonthQuery).Where("")
|
||||||
} else {
|
} else {
|
||||||
session = session.Where("bb.month in (?)", req.Month)
|
session = session.Where("bb.month = ?", req.Month)
|
||||||
}
|
}
|
||||||
err = session.Count(&total).Error
|
err = session.Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -694,9 +694,9 @@ inner join (
|
|||||||
// 当月增值限制类会过期型数据分析可使用额度
|
// 当月增值限制类会过期型数据分析可使用额度
|
||||||
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
// 当月套餐限制类型数据分析可使用额度
|
// 当月套餐限制类型数据分析可使用额度
|
||||||
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
// 当月增值限制类型数据分析可使用额度
|
// 当月增值限制类型数据分析可使用额度
|
||||||
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
|
|
||||||
// 重置单月消耗数量
|
// 重置单月消耗数量
|
||||||
v.MonthlyBundleVideoConsumptionNumber = 0
|
v.MonthlyBundleVideoConsumptionNumber = 0
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import (
|
|||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/duke-git/lancet/v2/datetime"
|
"github.com/duke-git/lancet/v2/datetime"
|
||||||
@ -39,7 +38,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
// }
|
// }
|
||||||
err = query.First(result).Error
|
err = query.First(result).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("总金额统计失败")
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将字符串转换为数值进行计算
|
// 将字符串转换为数值进行计算
|
||||||
@ -73,7 +72,7 @@ func MetricsBusiness(req *bundle.MetricsBusinessReq) (result *bundle.MetricsBusi
|
|||||||
|
|
||||||
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
subQuery = app.ModuleClients.BundleDB.Model(&model.Reconciliation{}).
|
||||||
Select("SUM(handling_fee) as new_fee_payment_amount, SUM(pay_amount) as new_payment_amount").
|
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 COLLATE utf8mb4_general_ci = reconciliation.bundle_order_on COLLATE utf8mb4_general_ci").
|
Joins("LEFT JOIN bundle_order_records bor ON bor.order_no = bundle_order_on").
|
||||||
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")
|
||||||
@ -1317,38 +1316,22 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
|||||||
var start time.Time
|
var start time.Time
|
||||||
var end time.Time
|
var end time.Time
|
||||||
var err error
|
var err error
|
||||||
|
if req.Month != "" {
|
||||||
subQuery := app.ModuleClients.BundleDB.Table("cast_media_account").
|
t, err := time.Parse("2006-01", req.Month)
|
||||||
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
start = datetime.BeginOfMonth(t)
|
start = datetime.BeginOfMonth(t)
|
||||||
end = datetime.EndOfMonth(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 {
|
} else {
|
||||||
start = time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC) // Unix 时间戳起始时间
|
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) // 设置一个很远的未来日期
|
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).
|
query := app.ModuleClients.BundleDB.Table("( ? ) cma", subQuery).
|
||||||
Select(`tiktok.platform_user_id as tiktok_account,
|
Select(`tiktok.platform_user_id as tiktok_account,
|
||||||
tiktok.platform_user_name as tiktok_nickname,
|
tiktok.platform_user_name as tiktok_nickname,
|
||||||
@ -1359,27 +1342,20 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
|||||||
ins.platform_user_id as instagram_account,
|
ins.platform_user_id as instagram_account,
|
||||||
ins.platform_user_name as instagram_nickname,
|
ins.platform_user_name as instagram_nickname,
|
||||||
ins_auth.auth_status as ins_auth_status,
|
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,
|
cma.artist_name,
|
||||||
bor.customer_num as user_num
|
bor.customer_num as user_num
|
||||||
`).
|
`).
|
||||||
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_account where platform_id = 1 and deleted_at = 0) 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_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 and expired != 2) dm on dm.artist_uuid = cma.artist_uuid`).
|
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_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_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 and expired != 2) ins on ins.artist_uuid = cma.artist_uuid`).
|
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_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_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`).
|
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")
|
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
|
err = query.Find(&data.Data).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1390,7 +1366,7 @@ func MetricsArtistAccountExport(req *bundle.MetricsArtistAccountExportReq) (*bun
|
|||||||
func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *bundle.MetricsVideoSubmitExportResp, err error) {
|
func MetricsVideoSubmitExport(req *bundle.MetricsVideoSubmitExportReq) (result *bundle.MetricsVideoSubmitExportResp, err error) {
|
||||||
result = &bundle.MetricsVideoSubmitExportResp{}
|
result = &bundle.MetricsVideoSubmitExportResp{}
|
||||||
var query *gorm.DB
|
var query *gorm.DB
|
||||||
if len(req.Month) == 0 {
|
if req.Month == "" {
|
||||||
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
query = app.ModuleClients.BundleDB.Table("cast_work AS cw").
|
||||||
Select(`cw.artist_name ,
|
Select(`cw.artist_name ,
|
||||||
cw.title as video_title,
|
cw.title as video_title,
|
||||||
@ -1405,61 +1381,22 @@ 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 = ''").
|
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 {
|
||||||
// 构建多个月份的时间范围参数
|
|
||||||
var timeRanges []struct {
|
|
||||||
Start int64
|
|
||||||
End int64
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, month := range req.Month {
|
t, err := time.Parse("2006-01", req.Month)
|
||||||
t, err := time.Parse("2006-01", month)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
start := datetime.BeginOfMonth(t)
|
start := datetime.BeginOfMonth(t)
|
||||||
end := datetime.EndOfMonth(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").
|
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`)
|
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()).
|
||||||
if len(timeRanges) > 0 {
|
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()).
|
||||||
// TikTok JOIN
|
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`).
|
||||||
tiktokTimeSQL, tiktokArgs := buildTimeFilterSQL("tiktok")
|
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)`).
|
||||||
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")
|
Order("cw.artist_name")
|
||||||
|
|
||||||
}
|
}
|
||||||
err = query.Find(&result.Data).Error
|
err = query.Find(&result.Data).Error
|
||||||
return
|
return
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/shopspring/decimal"
|
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -128,26 +127,6 @@ 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{}).
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
@ -539,7 +518,6 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
Amount: record.Amount,
|
Amount: record.Amount,
|
||||||
CustomerId: customerID,
|
CustomerId: customerID,
|
||||||
PayTime: record.PayTime,
|
PayTime: record.PayTime,
|
||||||
InviterId: record.InviterID,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 聚合子订单
|
// 聚合子订单
|
||||||
@ -829,19 +807,6 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
|
|||||||
PayStatus: int(req.PaymentStatus),
|
PayStatus: int(req.PaymentStatus),
|
||||||
SerialNumber: req.SerialNumber,
|
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 {
|
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
||||||
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -334,8 +334,8 @@ inner join (
|
|||||||
v.MonthlyIncreaseLimitImageNumber = v.MonthlyIncreaseLimitImageNumber - v.MonthlyIncreaseLimitImageConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
v.MonthlyIncreaseLimitImageNumber = v.MonthlyIncreaseLimitImageNumber - v.MonthlyIncreaseLimitImageConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
v.MonthlyBundleLimitExpiredDataAnalysisNumber = cal(v.BundleLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyBundleLimitExpiredDataAnalysisNumber = cal(v.BundleLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitExpiredDataAnalysisNumber = cal(v.IncreaseLimitDataAnalysisExpiredNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
||||||
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyBundleLimitDataAnalysisNumber = v.MonthlyBundleLimitDataAnalysisNumber - v.MonthlyBundleLimitDataAnalysisConsumptionNumber + cal(v.BundleLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitDataAnalysisNumber, v.MonthlyLimitDataAnalysisQuotaNumber)
|
v.MonthlyIncreaseLimitDataAnalysisNumber = v.MonthlyIncreaseLimitDataAnalysisNumber - v.MonthlyIncreaseLimitDataAnalysisConsumptionNumber + cal(v.IncreaseLimitImageNumber, v.MonthlyLimitImageQuotaNumber)
|
||||||
// 重置单月消耗数量
|
// 重置单月消耗数量
|
||||||
v.MonthlyBundleVideoConsumptionNumber = 0
|
v.MonthlyBundleVideoConsumptionNumber = 0
|
||||||
v.MonthlyIncreaseVideoConsumptionNumber = 0
|
v.MonthlyIncreaseVideoConsumptionNumber = 0
|
||||||
|
|||||||
@ -464,9 +464,9 @@ active_windows AS (
|
|||||||
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
|
bb.manual_data_analysis_number, bb.manual_data_analysis_consumption_number,
|
||||||
rn.name AS user_name
|
rn.name AS user_name
|
||||||
FROM ` + "`micro-account`.`user`" + ` u
|
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 AND rn.deleted_at = 0
|
INNER JOIN ` + "`micro-account`.real_name" + ` rn ON rn.id = u.real_name_id AND rn.name IS NOT NULL
|
||||||
INNER JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2
|
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 AND u.deleted_at = 0
|
INNER JOIN latest_bor bor ON bor.customer_id = u.id
|
||||||
INNER JOIN newest_month nm ON nm.user_id = u.id
|
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
|
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
|
WHERE u.deleted_at = 0
|
||||||
@ -527,25 +527,25 @@ balance_sum AS (
|
|||||||
GROUP BY bb2.user_id
|
GROUP BY bb2.user_id
|
||||||
),
|
),
|
||||||
|
|
||||||
-- 6. 作品统计(只统计 origin_uuid 为空的作品)
|
-- 6. 作品统计
|
||||||
cw_agg AS (
|
cw_agg AS (
|
||||||
SELECT
|
SELECT
|
||||||
aw.user_id,
|
aw.user_id,
|
||||||
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 = 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.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 = 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.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 = 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.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
|
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
|
||||||
FROM active_windows aw
|
FROM active_windows aw
|
||||||
LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
LEFT JOIN cast_work cw ON cw.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
||||||
GROUP BY aw.user_id
|
GROUP BY aw.user_id
|
||||||
),
|
),
|
||||||
|
|
||||||
-- 7. 数据分析作品统计(排除 work_analysis_status = 1 的数据分析)
|
-- 7. 数据分析作品统计
|
||||||
cwa_agg AS (
|
cwa_agg AS (
|
||||||
SELECT
|
SELECT
|
||||||
aw.user_id,
|
aw.user_id,
|
||||||
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.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.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
|
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
|
||||||
FROM active_windows aw
|
FROM active_windows aw
|
||||||
LEFT JOIN cast_work_analysis cwa ON cwa.artist_phone COLLATE utf8mb4_general_ci = aw.phone COLLATE utf8mb4_general_ci
|
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
|
GROUP BY aw.user_id
|
||||||
@ -810,49 +810,49 @@ func GetPendingUploadBreakdownBySubNums(subNums []string, page int, pageSize int
|
|||||||
" FROM cast_work cwv\n" +
|
" FROM cast_work cwv\n" +
|
||||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 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" +
|
||||||
" ((COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
" ((COALESCE(lbb.total_increase_video, 0) + bb.manual_video_number - bb.manual_video_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwv.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwv.uuid)\n" +
|
||||||
" FROM cast_work cwv\n" +
|
" FROM cast_work cwv\n" +
|
||||||
" JOIN cast_work_extra cwev ON cwev.work_uuid = cwv.uuid AND cwev.deleted_at = 0\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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 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" +
|
||||||
" (COALESCE(lbb.total_bundle_image, 0) - COALESCE((\n" +
|
" (COALESCE(lbb.total_bundle_image, 0) - COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||||
" FROM cast_work cwp\n" +
|
" FROM cast_work cwp\n" +
|
||||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 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" +
|
||||||
" ((COALESCE(lbb.total_increase_image, 0) + bb.manual_image_number - bb.manual_image_consumption_number) -\n" +
|
" ((COALESCE(lbb.total_increase_image, 0) + bb.manual_image_number - bb.manual_image_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
" SELECT COUNT(DISTINCT cwp.uuid)\n" +
|
||||||
" FROM cast_work cwp\n" +
|
" FROM cast_work cwp\n" +
|
||||||
" JOIN cast_work_extra cwep ON cwep.work_uuid = cwp.uuid AND cwep.deleted_at = 0\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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 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" +
|
||||||
" (COALESCE(lbb.total_bundle_data, 0) - COALESCE((\n" +
|
" (COALESCE(lbb.total_bundle_data, 0) - COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||||
" FROM cast_work_analysis ca\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" +
|
" 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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 0)) - COALESCE(COUNT(DISTINCT CASE WHEN 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(lbb.total_increase_data, 0) + bb.manual_data_analysis_number - bb.manual_data_analysis_consumption_number) -\n" +
|
||||||
" COALESCE((\n" +
|
" COALESCE((\n" +
|
||||||
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
" SELECT COUNT(DISTINCT ca.uuid)\n" +
|
||||||
" FROM cast_work_analysis ca\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" +
|
" 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" +
|
" 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.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" +
|
" 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 (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" +
|
" ), 0) - COALESCE(COUNT(DISTINCT CASE WHEN cwae.cost_type = 2 THEN cwa.uuid END), 0)) AS pending_increase_data_count,\n" +
|
||||||
" GREATEST(\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(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.origin_uuid = '' OR cw2.origin_uuid IS NULL) 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.submit_time BETWEEN bb.start_at AND bb.expired_at), 0),\n" +
|
||||||
" 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" +
|
" (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" +
|
"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" +
|
" (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" +
|
" 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`.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 AND rn.deleted_at = 0\n" +
|
"JOIN `micro-account`.real_name rn ON rn.id = u.real_name_id\n" +
|
||||||
"JOIN bundle_activate bc ON bc.user_id = u.id AND bc.activate = 2\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 AND u.deleted_at = 0\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\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" +
|
" (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" +
|
" 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 AND u.deleted_at = 0\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.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 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 cast_work_extra cwe ON cwe.work_uuid = cw.uuid AND cwe.deleted_at = 0\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.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 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_extra cwae ON cwae.analysis_uuid = cwa.uuid AND cwae.deleted_at = 0\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" +
|
"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"
|
"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,7 +16,6 @@ import (
|
|||||||
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"github.com/shopspring/decimal"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
|
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
|
||||||
@ -283,7 +282,7 @@ func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBund
|
|||||||
data.ExpiredAt = time.Now()
|
data.ExpiredAt = time.Now()
|
||||||
userId, err := strconv.Atoi(addValues[0].CustomerID)
|
userId, err := strconv.Atoi(addValues[0].CustomerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("获取用户ID失败")
|
return nil, err
|
||||||
}
|
}
|
||||||
data.Month = time.Now().Format("2006-01")
|
data.Month = time.Now().Format("2006-01")
|
||||||
data.UserId = userId
|
data.UserId = userId
|
||||||
@ -502,11 +501,11 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
|||||||
PageSize: 99999,
|
PageSize: 99999,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("余量列表数据失败")
|
return nil, err
|
||||||
}
|
}
|
||||||
prefixData, err := dao.BalanceExportPrefix()
|
prefixData, err := dao.BalanceExportPrefix()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("获取前缀数据失败")
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var prefixMap = map[int32]model.BundleExportDto{}
|
var prefixMap = map[int32]model.BundleExportDto{}
|
||||||
@ -545,14 +544,6 @@ func BundleBalanceExport(req *bundle.BundleBalanceExportReq) (*bundle.BundleBala
|
|||||||
} else {
|
} else {
|
||||||
item.IncreaseVideoUnitPrice = float32(math.Round(float64(item.IncreaseAmount/float32(v.IncreaseVideoNumber))*100) / 100)
|
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)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
return &bundle.BundleBalanceExportResp{Total: int64(len(items)), Data: items}, nil
|
||||||
|
|||||||
@ -68,8 +68,6 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
|
|||||||
ExpirationTime: req.ExpirationTime,
|
ExpirationTime: req.ExpirationTime,
|
||||||
Language: req.Language,
|
Language: req.Language,
|
||||||
BundleOrderValueAdd: addRecords,
|
BundleOrderValueAdd: addRecords,
|
||||||
PlatformIds: req.PlatformIds,
|
|
||||||
InviterID: req.InviterId,
|
|
||||||
}
|
}
|
||||||
res, err = dao.CreateOrderRecord(orderRecord)
|
res, err = dao.CreateOrderRecord(orderRecord)
|
||||||
return
|
return
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql/driver"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
@ -44,8 +42,6 @@ type BundleOrderRecords struct {
|
|||||||
Language string `gorm:"column:language;comment:语言" json:"language"`
|
Language string `gorm:"column:language;comment:语言" json:"language"`
|
||||||
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
|
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
|
||||||
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
|
ReSignature int `json:"reSignature" gorm:"column:re_signature;default:2;type:int;comment:是否重新签 1:是 2:否"`
|
||||||
PlatformIds PlatformIDs `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3 , DM = 4, BL = 5;" json:"platformIDs"`
|
|
||||||
InviterID uint64 `gorm:"column:inviter_id;type:bigint;comment:邀请人ID" json:"inviterID"`
|
|
||||||
}
|
}
|
||||||
type BundleOrderValueAdd struct {
|
type BundleOrderValueAdd struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
@ -77,30 +73,6 @@ type BundleOrderValueAdd struct {
|
|||||||
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
QuotaValue int32 `json:"quotaValue" gorm:"column:quota_value;type:int;comment:额度值"`
|
||||||
IsExpired bool `json:"isExpired" gorm:"column:is_expired;default:false;comment:是否过期作废 false:不作废 true:作废"`
|
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 (
|
const (
|
||||||
|
|||||||
@ -217,8 +217,6 @@ message OrderCreateRecord{
|
|||||||
int32 payType = 19 [json_name = "payType"];
|
int32 payType = 19 [json_name = "payType"];
|
||||||
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
||||||
string orderNo = 21 [json_name = "orderNo"];
|
string orderNo = 21 [json_name = "orderNo"];
|
||||||
repeated uint32 platformIds = 22; // 发布平台ID集合 (json 格式字符串)
|
|
||||||
uint64 inviterId = 23; // 邀请人ID
|
|
||||||
}
|
}
|
||||||
message OrderCreateAddRecord{
|
message OrderCreateAddRecord{
|
||||||
int32 serviceType = 1 [json_name = "serviceType"];
|
int32 serviceType = 1 [json_name = "serviceType"];
|
||||||
@ -271,9 +269,6 @@ message OrderBundleRecordInfo{
|
|||||||
int64 customerId = 9;
|
int64 customerId = 9;
|
||||||
string payTime = 10;
|
string payTime = 10;
|
||||||
string subNum = 11;
|
string subNum = 11;
|
||||||
uint64 inviterId = 12;
|
|
||||||
string inviterCode = 13;
|
|
||||||
string inviterName = 14;
|
|
||||||
}
|
}
|
||||||
message OrderAddBundleRecordInfo{
|
message OrderAddBundleRecordInfo{
|
||||||
string orderAddNo = 1;
|
string orderAddNo = 1;
|
||||||
@ -731,7 +726,7 @@ message GetBundleBalanceListReq{
|
|||||||
int64 expiredTimeEnd = 8;
|
int64 expiredTimeEnd = 8;
|
||||||
int32 page = 9;
|
int32 page = 9;
|
||||||
int32 pageSize = 10;
|
int32 pageSize = 10;
|
||||||
repeated string month = 11;
|
string month = 11;
|
||||||
int32 statusType = 12;
|
int32 statusType = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -915,15 +910,11 @@ message BundleBalanceExportItem {
|
|||||||
int32 monthlyManualVideoConsumptionNumber = 65; // 当月手动扩展视频使用数
|
int32 monthlyManualVideoConsumptionNumber = 65; // 当月手动扩展视频使用数
|
||||||
int32 monthlyManualImageConsumptionNumber = 66; // 当月手动扩展图文使用数
|
int32 monthlyManualImageConsumptionNumber = 66; // 当月手动扩展图文使用数
|
||||||
int32 monthlyManualDataAnalysisConsumptionNumber = 67; // 当月手动扩展数据分析使用数
|
int32 monthlyManualDataAnalysisConsumptionNumber = 67; // 当月手动扩展数据分析使用数
|
||||||
|
|
||||||
//视频当月消耗金额
|
|
||||||
string monthlyBundleVideoConsumptionPrice = 68;//当月套餐消耗总金额
|
|
||||||
string monthlyIncreaseVideoConsumptionPrice = 69;//当月增值消耗总金额
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message BundleBalanceExportReq{
|
message BundleBalanceExportReq{
|
||||||
repeated string month = 1;
|
string month = 1;
|
||||||
string userName = 2;
|
string userName = 2;
|
||||||
uint64 expiredTimeStart = 3;
|
uint64 expiredTimeStart = 3;
|
||||||
uint64 expiredTimeEnd = 4;
|
uint64 expiredTimeEnd = 4;
|
||||||
@ -1770,7 +1761,7 @@ message MetricsBundlePurchaseItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
message MetricsArtistAccountExportReq{
|
message MetricsArtistAccountExportReq{
|
||||||
repeated string month = 1;
|
string month = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricsArtistAccountExportResp{
|
message MetricsArtistAccountExportResp{
|
||||||
@ -1783,24 +1774,20 @@ message MetricsArtistAccountExportItem{
|
|||||||
string dmAccount = 3;
|
string dmAccount = 3;
|
||||||
string dmNickname = 4;
|
string dmNickname = 4;
|
||||||
int32 dmAuthStatus = 5;
|
int32 dmAuthStatus = 5;
|
||||||
|
// string youtubeAccount = 3; 现在没有YouTube了
|
||||||
|
// string youtubeNickname = 4;
|
||||||
string instagramAccount = 6;
|
string instagramAccount = 6;
|
||||||
string instagramNickname = 7;
|
string instagramNickname = 7;
|
||||||
int32 insAuthStatus = 8;
|
int32 insAuthStatus = 8;
|
||||||
string tiktokAccount = 9;
|
string tiktokAccount = 9;
|
||||||
string tiktokNickname = 10;
|
string tiktokNickname = 10;
|
||||||
int32 tiktokAuthStatus = 11;
|
int32 tiktokAuthStatus = 11;
|
||||||
string youtubeAccount = 12;
|
|
||||||
string youtubeNickname = 13;
|
|
||||||
int32 youtubeAuthStatus = 14;
|
|
||||||
string blueskyAccount = 15;
|
|
||||||
string blueskyNickname = 16;
|
|
||||||
int32 blueskyAuthStatus = 17;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
message MetricsVideoSubmitExportReq{
|
message MetricsVideoSubmitExportReq{
|
||||||
repeated string month = 1;
|
string month = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricsVideoSubmitExportResp{
|
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.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.5
|
// - protoc-gen-go-triple v1.0.8
|
||||||
// - protoc v5.26.0
|
// - protoc v3.21.1
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
|
|||||||
@ -63,16 +63,7 @@ func loadMysqlConn(conn string) *gorm.DB {
|
|||||||
&model.BundleActivate{},
|
&model.BundleActivate{},
|
||||||
&model.BundleBalanceLayout{},
|
&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 {
|
if err != nil {
|
||||||
// return nil
|
// return nil
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user