Commit bd852b92 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/filter' into 'main'

修复组卡页过滤器(灵摆怪兽条件下选择特定星级无法搜出卡)

See merge request mycard/Neos!354
parents cda9dcde 2fbf92b5
......@@ -48,14 +48,17 @@ export function invokeFts(db: Database, params: FtsParams): CardMeta[] {
}
function getFtsCondtions(conditions: FtsConditions): string {
const { types, levels, atk, def, races, attributes } = conditions;
const { types, levels, lscales, atk, def, races, attributes } = conditions;
const assertMonster = `(type & ${TYPE_MONSTER}) > 0`;
const typesCondition = types
.map((type) => `(type & ${type}) > 0`)
.join(" OR ");
const levelsCondition = levels
.map((level) => `level = ${level}`)
.map((level) => `(level & 0xff) = ${level}`)
.join(" OR ");
const lscalesCondition = lscales
.map((lscale) => `((level >> 0x18) & 0xff) = ${lscale}`)
.join(" OR ");
const atkCondition =
atk.min !== null || atk.max !== null
......@@ -79,6 +82,7 @@ function getFtsCondtions(conditions: FtsConditions): string {
const merged = [
typesCondition,
levelsCondition,
lscalesCondition,
atkCondition,
defCondition,
raceCondition,
......
......@@ -115,7 +115,6 @@ export const Filter: React.FC<{
type="primary"
onClick={() => {
onConfirm(newConditions);
console.log(newConditions);
}}
>
确定
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment