refactor(db): Detect DB type using PDO driver name
This commit is contained in:
@@ -925,7 +925,7 @@ class Model
|
|||||||
$search = static::bind($search);
|
$search = static::bind($search);
|
||||||
$where = [];
|
$where = [];
|
||||||
|
|
||||||
if (DB_TYPE == 'sqlite') {
|
if (static::db()->getAttribute(PDO::ATTR_DRIVER_NAME) == 'sqlite') {
|
||||||
foreach ($in as $row) {
|
foreach ($in as $row) {
|
||||||
$where[] = "$row LIKE '%' || $search || '%'";
|
$where[] = "$row LIKE '%' || $search || '%'";
|
||||||
}
|
}
|
||||||
@@ -935,7 +935,6 @@ class Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (static::$querySelect['where'] == '') {
|
if (static::$querySelect['where'] == '') {
|
||||||
static::$querySelect['where'] = join(' OR ', $where);
|
static::$querySelect['where'] = join(' OR ', $where);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user