Fixed various actor filters. Improved tag bar scroll behavior.
This commit is contained in:
@@ -367,12 +367,24 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
builder.whereRaw('match(\'@name :query:\', actors)', { query: filters.query });
|
||||
}
|
||||
|
||||
['gender', 'country'].forEach((attribute) => {
|
||||
// attribute filters
|
||||
['country'].forEach((attribute) => {
|
||||
if (filters[attribute]) {
|
||||
builder.where(attribute, filters[attribute]);
|
||||
}
|
||||
});
|
||||
|
||||
if (filters.gender === 'other') {
|
||||
builder.whereNull('gender');
|
||||
} else if (filters.gender) {
|
||||
builder.where('gender', filters.gender);
|
||||
}
|
||||
|
||||
if (filters.age) {
|
||||
builder.select('if(date_of_birth, floor((now() - date_of_birth) / 31556952), 0) as age');
|
||||
}
|
||||
|
||||
// range filters
|
||||
['age', 'height'].forEach((attribute) => {
|
||||
if (filters[attribute]) {
|
||||
builder
|
||||
@@ -396,9 +408,11 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||
const month = filters.dateOfBirth.getMonth() + 1;
|
||||
const day = filters.dateOfBirth.getDate();
|
||||
|
||||
builder.select('month(date_of_birth) as month_of_birth, day(date_of_birth) as day_of_birth');
|
||||
|
||||
builder
|
||||
.where('month(date_of_birth)', month)
|
||||
.where('day(date_of_birth)', day);
|
||||
.where('month_of_birth', month)
|
||||
.where('day_of_birth', day);
|
||||
}
|
||||
|
||||
if (filters.cup) {
|
||||
|
||||
Reference in New Issue
Block a user