orm: IFNULL, NULLIF functions
This commit is contained in:
@@ -162,6 +162,8 @@ abstract class Base
|
||||
'NOT',
|
||||
'IN',
|
||||
'NOT_IN',
|
||||
'IFNULL',
|
||||
'NULLIF',
|
||||
'BINARY',
|
||||
'UNIX_TIMESTAMP',
|
||||
'TIMESTAMPDIFF_DAY',
|
||||
@@ -195,6 +197,8 @@ abstract class Base
|
||||
'MUL',
|
||||
'DIV',
|
||||
'MOD',
|
||||
'IFNULL',
|
||||
'NULLIF',
|
||||
'TIMESTAMPDIFF_DAY',
|
||||
'TIMESTAMPDIFF_MONTH',
|
||||
'TIMESTAMPDIFF_YEAR',
|
||||
|
||||
@@ -764,6 +764,17 @@ class QueryTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals($expectedSql, $sql);
|
||||
}
|
||||
|
||||
public function testFunction18()
|
||||
{
|
||||
$sql = $this->query->createSelectQuery('Comment', [
|
||||
'select' => [["IFNULL:(name, '')", 'test']],
|
||||
'withDeleted' => true
|
||||
]);
|
||||
$expectedSql =
|
||||
"SELECT IFNULL(comment.name, '') AS `test` FROM `comment`";
|
||||
$this->assertEquals($expectedSql, $sql);
|
||||
}
|
||||
|
||||
public function testFunctionTZ1()
|
||||
{
|
||||
$sql = $this->query->createSelectQuery('Comment', [
|
||||
|
||||
Reference in New Issue
Block a user