Merge branch 'dev-lzh' into dev
This commit is contained in:
commit
fabc41aa92
@ -98,7 +98,7 @@ func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data
|
||||
}
|
||||
|
||||
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
|
||||
session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_balance AS bb").
|
||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").
|
||||
Select(`
|
||||
bb.*,
|
||||
bor.expiration_time as expired_time,
|
||||
@ -108,10 +108,10 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
rn.name as user_name,
|
||||
u.tel_num as user_phone_number
|
||||
`).
|
||||
Joins("INNER JOIN bundle_order_records bor on bor.uuid = bb.order_uuid").
|
||||
Joins("LEFT JOIN `micro-account`.`user` u on u.id = bb.user_id").
|
||||
Joins("LEFT JOIN fiee_bundle.bundle_balance AS bb on u.id = bb.user_id").
|
||||
Joins("LEFT JOIN `micro-account`.`real_name` rn on u.real_name_id = rn.id").
|
||||
Where("bor.deleted_at IS NULL")
|
||||
Joins("LEFT JOIN bundle_order_records bor on bor.uuid = bb.order_uuid").
|
||||
Where("bor.deleted_at IS NULL and rn.name IS NOT NULL")
|
||||
if req.UserName != "" {
|
||||
session = session.Where("rn.name like ?", "%"+req.UserName+"%")
|
||||
}
|
||||
@ -127,6 +127,12 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
||||
if req.ExpiredTimeStart != 0 {
|
||||
session = session.Where("bor.expiration_time >= ?", time.UnixMilli(req.ExpiredTimeStart))
|
||||
}
|
||||
if req.Bought == 2 {
|
||||
session = session.Where("bor.uuid IS NOT NULL")
|
||||
}
|
||||
if req.Bought == 1 {
|
||||
session = session.Where("bor.uuid IS NULL")
|
||||
}
|
||||
err = session.Count(&total).Error
|
||||
if err != nil {
|
||||
return
|
||||
|
@ -47,10 +47,6 @@ func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundl
|
||||
result := &bundle.BundleExtendRecordItem{}
|
||||
copier.Copy(result, &m)
|
||||
result.CreatedAt = uint64(m.CreatedAt.UnixMilli())
|
||||
if result.Type == 2 { // 自行购买的情况下操作人就是用户
|
||||
result.OperatorName = result.UserName
|
||||
result.OperatorPhoneNumber = result.UserPhoneNumber
|
||||
}
|
||||
return result
|
||||
})
|
||||
return resp, nil
|
||||
|
@ -596,10 +596,11 @@ message GetBundleBalanceListReq{
|
||||
string userName = 1;
|
||||
int32 status = 2;
|
||||
string bundleName = 3;
|
||||
int64 expiredTimeStart = 4;
|
||||
int64 expiredTimeEnd = 5;
|
||||
int32 page = 6;
|
||||
int32 pageSize = 7;
|
||||
int32 bought = 4;
|
||||
int64 expiredTimeStart = 5;
|
||||
int64 expiredTimeEnd = 6;
|
||||
int32 page = 7;
|
||||
int32 pageSize = 8;
|
||||
}
|
||||
|
||||
message GetBundleBalanceReq{
|
||||
|
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 v4.24.0--rc1
|
||||
// - protoc v3.20.3
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
|
Loading…
Reference in New Issue
Block a user