移除宝箱助力记录的登录检查, 宝箱助力信息增加返回宝箱品级
This commit is contained in:
parent
090c064131
commit
ef1b731202
@ -62,9 +62,9 @@ class BoxController extends BaseController {
|
||||
/**
|
||||
* 宝箱助力列表
|
||||
*/
|
||||
@role(ROLE_ANON)
|
||||
@router('post /api/chest/enhance/list')
|
||||
async enhanceList(req) {
|
||||
const user = req.user
|
||||
let { chestId, chestid } = req.params
|
||||
chestid = chestId || chestid
|
||||
if (!isObjectIdString(chestid)) {
|
||||
@ -78,7 +78,7 @@ class BoxController extends BaseController {
|
||||
throw new ZError(13, 'chest is locked')
|
||||
}
|
||||
const result = []
|
||||
const records = await ChestEnhanceRecord.find({ chest: chest.id, activity: user.activity }).sort({ score: -1 })
|
||||
const records = await ChestEnhanceRecord.find({ chest: chest.id }).sort({ score: -1 })
|
||||
const uids = records.map(record => record.user)
|
||||
const users = await ActivityUser.find({ _id: { $in: uids } })
|
||||
const userMap = new Map()
|
||||
@ -165,6 +165,7 @@ class BoxController extends BaseController {
|
||||
userCurrent,
|
||||
userMax,
|
||||
enhanced,
|
||||
level: chest.level,
|
||||
nickname:
|
||||
chestOwner?.twitterName || chestOwner?.discordName || chestOwner?.address
|
||||
? formatAddress(chestOwner.address)
|
||||
@ -177,6 +178,7 @@ class BoxController extends BaseController {
|
||||
return {
|
||||
chestCurrent: chest.bonusUsers.length,
|
||||
chestMax: chest.maxBounsCount,
|
||||
level: chest.level,
|
||||
nickname:
|
||||
chestOwner?.twitterName || chestOwner?.discordName || chestOwner?.address
|
||||
? formatAddress(chestOwner.address)
|
||||
|
Loading…
x
Reference in New Issue
Block a user