国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman/admin 配置Pgsql

Achun

先在前臺測試連接數(shù)據(jù)庫,查詢數(shù)據(jù)成功后再進(jìn)行操作,記得先添加php擴(kuò)展
(pgsql不是管理員賬號一些操作會(huì)沒有權(quán)限 username: postgres)
截圖

在插件新增pgsql配置

截圖


截圖

copy Crud 重寫為 Pgsql

截圖

重寫Pgsql selectInput方法

截圖

$allow_column = Db::connection('plugin.admin.pgsql')
            ->select("SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '$table'");

        if (!$allow_column) {
            throw new BusinessException('表不存在');
        }
        $columns = array_column($allow_column, 'column_name', 'Field');
        $allow_column = array_flip($columns);
        if (!in_array($field, $columns)) {
            $field = null;
        }

重寫Pgsql inputFilter方法

截圖

$allow_column = Db::connection('plugin.admin.pgsql')
            ->select("SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '$table'");
        if (!$allow_column) {
            throw new BusinessException('表不存在', 2);
        }
        $columns = array_column($allow_column, 'column_name', 'Field');
        $columns = array_flip($columns);

最后修改模型連接配置

截圖


目前增刪改查操作都正常

截圖

871 0 2
0個(gè)評論

Achun

340
積分
0
獲贊數(shù)
0
粉絲數(shù)
2023-12-04 加入
??