Update database.php

This commit is contained in:
Namhyeon Go 2019-06-18 16:48:51 +09:00 committed by GitHub
parent 2b78e5cb38
commit 0bc123b387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -382,7 +382,7 @@ if(!check_function_exists("get_bind_to_sql_select")) {
// use simple distance
if(!array_key_empty("simple_distance", $v)) {
if(check_array_length($v['simple_distance'], 2) == 0) {
$a = $v['simple_distance'][1]; // percentage (range 0 to 1)
$a = floatval($v['simple_distance'][1]); // percentage (range 0 to 1)
$b = $v['simple_distance'][0]; // field or number
$s1a[$k] = sprintf("abs(1.0 - (abs(%s - %s) / %s))", $b, $a, $a);
}