Fix SQL for previews
This commit is contained in:
parent
b14f3c87f1
commit
e092ae3231
1 changed files with 3 additions and 3 deletions
|
@ -40,7 +40,7 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
|
||||||
params.push(claimId + '%');
|
params.push(claimId + '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
sql += ' AND claim.bid_state in ("controlling", "active", "accepted") ORDER BY claim.bid_state desc';
|
sql += ' AND claim.bid_state in ("controlling", "active", "accepted")';
|
||||||
|
|
||||||
if (claimName[0] !== '@' && channelName) {
|
if (claimName[0] !== '@' && channelName) {
|
||||||
sql += ' AND channel_claim.name = ?';
|
sql += ' AND channel_claim.name = ?';
|
||||||
|
@ -49,11 +49,11 @@ module.exports.getClaim = async function getClaim(claimName, claimId, channelNam
|
||||||
sql += ' AND channel_claim.claim_id LIKE ?';
|
sql += ' AND channel_claim.claim_id LIKE ?';
|
||||||
params.push(channelClaimId + '%');
|
params.push(channelClaimId + '%');
|
||||||
} else {
|
} else {
|
||||||
sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted") ORDER BY channel_claim.bid_state desc';
|
sql += ' AND channel_claim.bid_state in ("controlling", "active", "accepted")';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sql += ' LIMIT 1';
|
sql += ' ORDER BY claim.bid_state DESC LIMIT 1';
|
||||||
|
|
||||||
return queryPool(sql, params);
|
return queryPool(sql, params);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue