FIX Use the SQL standard for the if confition

This commit is contained in:
Laurent Destailleur 2021-11-18 19:38:56 +01:00
parent d24120d6f9
commit e81c118a27

View File

@ -77,7 +77,8 @@ abstract class DoliDB implements Database
*/
public function ifsql($test, $resok, $resko)
{
return 'IF('.$test.','.$resok.','.$resko.')';
//return 'IF('.$test.','.$resok.','.$resko.')'; // Not sql standard
return '(CASE WHEN '.$test.' THEN '.$resok.' ELSE '.$resko.' END)';
}
/**