mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
驱动改进
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace think\db\connector;
|
||||
|
||||
use PDO;
|
||||
use think\Db;
|
||||
use think\db\Connection;
|
||||
|
||||
@@ -104,7 +105,7 @@ class Oracle extends Connection
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
$sql = "select a.column_name,data_type,DECODE (nullable, 'Y', 0, 1) notnull,data_default, DECODE (A .column_name,b.column_name,1,0) pk from all_tab_columns a,(select column_name from all_constraints c, all_cons_columns col where c.constraint_name = col.constraint_name and c.constraint_type = 'P' and c.table_name = '" . strtoupper($tableName) . "' ) b where table_name = '" . strtoupper($tableName) . "' and a.column_name = b.column_name (+)";
|
||||
$pdo = $this->linkID->query($sql);
|
||||
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
if ($result) {
|
||||
foreach ($result as $key => $val) {
|
||||
@@ -131,7 +132,7 @@ class Oracle extends Connection
|
||||
public function getTables()
|
||||
{
|
||||
$pdo = $this->linkID->query("select table_name from all_tables");
|
||||
$result = $pdo->fetchAll(\PDO::FETCH_ASSOC);
|
||||
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
|
||||
$info = [];
|
||||
foreach ($result as $key => $val) {
|
||||
$info[$key] = current($val);
|
||||
|
||||
Reference in New Issue
Block a user