Update database.php
This commit is contained in:
parent
923eb1e3cc
commit
1925a391b8
|
@ -371,13 +371,20 @@ if(!check_function_exists("get_bind_to_sql_select")) {
|
||||||
$s1a[$k] = sprintf("concat(%s)", implode(sprintf(", '%s', ", $v['delimiter']), $v['concat']));
|
$s1a[$k] = sprintf("concat(%s)", implode(sprintf(", '%s', ", $v['delimiter']), $v['concat']));
|
||||||
}
|
}
|
||||||
|
|
||||||
// use function
|
// use mysql function
|
||||||
if(!array_key_empty("call_func", $v)) {
|
if(!array_key_empty("sql_function", $v)) {
|
||||||
if(check_array_length($v['call_func'], 1) > 0) {
|
if(check_array_length($v['sql_function'], 1) > 0) {
|
||||||
// add to s1a
|
// add to s1a
|
||||||
$s1a[$k] = sprintf("%s(%s)", $v['call_func'][0], implode(", ", array_slice($v['call_func'], 1)));
|
$s1a[$k] = sprintf("%s(%s)", $v['sql_function'][0], implode(", ", array_slice($v['sql_function'], 1)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// use simple distance
|
||||||
|
if(!array_key_empty("simple_distance", $v)) {
|
||||||
|
$a = $v['simple_distance'][0];
|
||||||
|
$b = $v['simple_distance'][1];
|
||||||
|
$s1a[$k] = sprintf("abs(1.0 - (abs(%s - %s) / %s))", $b, $a, $a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user