Updata:解决冲突
This commit is contained in:
commit
512c3683ef
@ -3,6 +3,7 @@ package dao
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/app"
|
||||
@ -537,13 +538,17 @@ func ConfirmWork(req *bundle.ConfirmWorkReq) error {
|
||||
}
|
||||
|
||||
func GetWaitConfirmWorkList() (data []model.CastWork, err error) {
|
||||
twentyFourHoursAgo := time.Now().Add(-24 * time.Hour).Format("2006-01-02 15:04:05")
|
||||
randomHours := rand.Intn(22) + 2 // 2-22小时
|
||||
now := time.Now()
|
||||
startTime := now.Add(-time.Duration(randomHours+2) * time.Hour).Format("2006-01-02 15:04:05")
|
||||
endTime := now.Add(-time.Duration(randomHours) * time.Hour).Format("2006-01-02 15:04:05")
|
||||
err = app.ModuleClients.BundleDB.Model(&model.CastWork{}).
|
||||
Where("deleted_at = 0").
|
||||
Where("status = ?", 4).
|
||||
Where("submit_time >= ?", twentyFourHoursAgo).
|
||||
Where("submit_time > ?", startTime).
|
||||
Where("submit_time < ?", endTime).
|
||||
Order("submit_time asc").
|
||||
Limit(10).
|
||||
Limit(5).
|
||||
Find(&data).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@ -8,6 +8,7 @@ import (
|
||||
"micro-bundle/internal/dao"
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/msg"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@ -194,9 +195,16 @@ func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.
|
||||
if data.Activate != 2 {
|
||||
return nil, errors.New("套餐未激活")
|
||||
}
|
||||
var IsExpired int32
|
||||
if data.ExpiredAt.Before(time.Now()) {
|
||||
IsExpired = msg.IsExpired
|
||||
} else {
|
||||
IsExpired = msg.NotExpired
|
||||
}
|
||||
result := &bundle.GetBundleBalanceByUserIdResp{
|
||||
OrderUUID: data.OrderUUID,
|
||||
BundleName: data.BundleName,
|
||||
BundleStatus: IsExpired,
|
||||
PayTime: data.StartAt.UnixMilli(),
|
||||
ExpiredTime: data.ExpiredAt.UnixMilli(),
|
||||
PaymentAmount: data.PaymentAmount,
|
||||
|
||||
@ -1060,7 +1060,7 @@ message GetBundleBalanceByUserIdResp{
|
||||
string orderUUID = 1;
|
||||
string bundleUuid = 2; // 套餐ID uuid
|
||||
string bundleName = 3; // 套餐名称
|
||||
string bundleStatus = 4; // 套餐名称
|
||||
int32 bundleStatus = 4; // 套餐状态是否过期 1 是 0 否
|
||||
int64 payTime = 5;
|
||||
int64 expiredTime = 6;
|
||||
string paymentAmount = 7;
|
||||
|
||||
@ -8763,9 +8763,9 @@ type GetBundleBalanceByUserIdResp struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OrderUUID string `protobuf:"bytes,1,opt,name=orderUUID,proto3" json:"orderUUID"`
|
||||
BundleUuid string `protobuf:"bytes,2,opt,name=bundleUuid,proto3" json:"bundleUuid"` // 套餐ID uuid
|
||||
BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName"` // 套餐名称
|
||||
BundleStatus string `protobuf:"bytes,4,opt,name=bundleStatus,proto3" json:"bundleStatus"` // 套餐名称
|
||||
BundleUuid string `protobuf:"bytes,2,opt,name=bundleUuid,proto3" json:"bundleUuid"` // 套餐ID uuid
|
||||
BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName"` // 套餐名称
|
||||
BundleStatus int32 `protobuf:"varint,4,opt,name=bundleStatus,proto3" json:"bundleStatus"` // 套餐状态是否过期 1 是 0 否
|
||||
PayTime int64 `protobuf:"varint,5,opt,name=payTime,proto3" json:"payTime"`
|
||||
ExpiredTime int64 `protobuf:"varint,6,opt,name=expiredTime,proto3" json:"expiredTime"`
|
||||
PaymentAmount string `protobuf:"bytes,7,opt,name=paymentAmount,proto3" json:"paymentAmount"`
|
||||
@ -8845,11 +8845,11 @@ func (x *GetBundleBalanceByUserIdResp) GetBundleName() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetBundleBalanceByUserIdResp) GetBundleStatus() string {
|
||||
func (x *GetBundleBalanceByUserIdResp) GetBundleStatus() int32 {
|
||||
if x != nil {
|
||||
return x.BundleStatus
|
||||
}
|
||||
return ""
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetBundleBalanceByUserIdResp) GetPayTime() int64 {
|
||||
@ -16917,7 +16917,7 @@ var file_pb_bundle_proto_rawDesc = []byte{
|
||||
0x75, 0x6e, 0x64, 0x6c, 0x65, 0x55, 0x75, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x62, 0x75, 0x6e,
|
||||
0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62,
|
||||
0x75, 0x6e, 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x75, 0x6e,
|
||||
0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0c, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x70, 0x61, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
|
||||
0x70, 0x61, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72,
|
||||
|
||||
@ -120,3 +120,9 @@ const (
|
||||
AccountService = 4 //账号数
|
||||
AvailableTimeService = 5 //可用时长
|
||||
)
|
||||
|
||||
// 是否过期
|
||||
const (
|
||||
IsExpired = 1 //是
|
||||
NotExpired = 0 //否
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user