添加作品提交时间
This commit is contained in:
parent
1d6b207aea
commit
ec1e99ec42
@ -218,8 +218,10 @@ func CreateBundleBalance(data model.BundleBalance) error {
|
||||
return app.ModuleClients.BundleDB.Create(&data).Error
|
||||
}
|
||||
|
||||
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, total int64, err error) {
|
||||
session := app.ModuleClients.BundleDB.Model(&model.CostLog{})
|
||||
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLogPo, total int64, err error) {
|
||||
session := app.ModuleClients.BundleDB.Table("cast_cost_log as ccl").Select("ccl.*,cwe.artist_confirmed_time").
|
||||
Joins("left join cast_work_extra as cwe on cwe.work_uuid = ccl.work_uuid").
|
||||
Where("ccl.deleted_at = 0")
|
||||
if req.Title != "" {
|
||||
session = session.Where("title = ?", req.Title)
|
||||
}
|
||||
@ -230,10 +232,10 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
|
||||
session = session.Where(fmt.Sprintf(`JSON_CONTAINS(media_names,'"%s"')`, req.Account))
|
||||
}
|
||||
if req.SubmitTimeEnd != 0 {
|
||||
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
|
||||
session = session.Where("artist_confirmed_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
|
||||
}
|
||||
if req.SubmitTimeStart != 0 {
|
||||
session = session.Where("submit_time >= ?", time.UnixMilli(req.SubmitTimeStart))
|
||||
session = session.Where("artist_confirmed_time >= ?", time.UnixMilli(req.SubmitTimeStart))
|
||||
}
|
||||
if req.User != "" {
|
||||
if utils.IsPhoneNumber(req.User) {
|
||||
@ -258,7 +260,7 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
|
||||
if req.Page != 0 && req.PageSize != 0 {
|
||||
session = session.Offset(int(req.Page-1) * int(req.PageSize)).Limit(int(req.PageSize))
|
||||
}
|
||||
err = session.Order("updated_at desc").Find(&data).Error
|
||||
err = session.Order("ccl.updated_at desc").Find(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListR
|
||||
}
|
||||
resp := &bundle.GetUsedRecordListResp{}
|
||||
resp.Total = total
|
||||
resp.Data = lo.Map(data, func(m model.CostLog, _ int) *bundle.WorkCastItem {
|
||||
resp.Data = lo.Map(data, func(m model.CostLogPo, _ int) *bundle.WorkCastItem {
|
||||
result := &bundle.WorkCastItem{}
|
||||
copier.Copy(result, &m)
|
||||
return result
|
||||
|
@ -31,6 +31,23 @@ func (CostLog) TableName() string {
|
||||
return "cast_cost_log"
|
||||
}
|
||||
|
||||
type CastWorkExtra struct {
|
||||
WorkUuid string `gorm:"column:work_uuid;type:varchar(50);primary_key;comment:作品uuid" json:"work_uuid"`
|
||||
CreatedAt int `gorm:"column:created_at;type:int(11)" json:"created_at"`
|
||||
UpdatedAt int `gorm:"column:updated_at;type:int(11)" json:"updated_at"`
|
||||
DeletedAt uint64 `gorm:"column:deleted_at;type:bigint(20) unsigned" json:"deleted_at"`
|
||||
ArtistConfirmedTime int64 `gorm:"column:artist_confirmed_time;type:bigint(20);default:0;comment:艺人确认时间;NOT NULL" json:"artist_confirmed_time"`
|
||||
}
|
||||
|
||||
func (m *CastWorkExtra) TableName() string {
|
||||
return "cast_work_extra"
|
||||
}
|
||||
|
||||
type CostLogPo struct {
|
||||
CostLog
|
||||
ArtistConfirmedTime int64 `gorm:"column:artist_confirmed_time;type:bigint(20);default:0;comment:艺人确认时间;NOT NULL" json:"artist_confirmed_time"`
|
||||
}
|
||||
|
||||
type CastWorkImage struct {
|
||||
Uuid string `json:"uuid" gorm:"uuid"`
|
||||
WorkUuid string `json:"work_uuid" gorm:"work_uuid"` // 作品uuid
|
||||
|
Loading…
Reference in New Issue
Block a user