分类 默认 下的文章

    #转发机制
location /{
    index  index.html index.htm;
    if (!-e $request_filename) {
        rewrite ^/(.*) /index.html last;
        break;
    }
}

 实现:https://h5.xxx.com/mobile/acticity/album?id=1

function get_init_field($table){
            //$table=$this->request->param('model');
            $dbname = Config::get('database.database');
            $prefix = Config::get('database.prefix');
            $sql="select COLUMN_NAME ,DATA_TYPE from information_schema.COLUMNS where TABLE_SCHEMA = ? and table_name = ? and DATA_TYPE = 'int'";
            $columnList = Db::query($sql, [$dbname, $table]);
            $fieldlist = [];
            foreach ($columnList as $index => $item) {
            $fieldlist[] = $item['COLUMN_NAME'];
            }
            return json($fieldlist);
}

名词解释

$table 即为表名
$dbname 数据库名
$prefix 数据库前缀

命令

select COLUMN_NAME ,DATA_TYPE from information_schema.COLUMNS where TABLE_SCHEMA ='washbox' and table_name = 'fa_user' and DATA_TYPE = 'int';

在centos7.5主机部署了lnmp1.8环境
部署thinkphp5的程序时候,rewrite转发配置正常。但显示空白,经过多番研究,发现是fastcgi的安全目录open_Dir问题
/usr/local/nginx/conf
【fastcgi.conf】
大概在26-27行

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;
#未改前
#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
#修改后
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/../:/tmp/:/proc/";

OK 大功告成