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