ThinkPHP 3.2 获取 MySQL 数据库数据表字段的备注信息

//获取备注信息
public function _get_field() {
	$model = new \Think\Model();
	$controller_name = $this->CamelCaseToUnderScore(CONTROLLER_NAME);
	$rs = $model->query("select `column_name`,`column_comment` from information_schema.COLUMNS WHERE TABLE_SCHEMA = '".C('DB_NAME')."' AND TABLE_NAME = '".C('DB_PREFIX').$controller_name."'");
	return $rs;
}

//驼峰命名转下划线命名
public function CamelCaseToUnderScore($str){
	$dstr = preg_replace_callback('/([A-Z]+)/',function($matchs){
	  return '_'.strtolower($matchs[0]);
	},$str);
	return trim(preg_replace('/_{2,}/','_',$dstr),'_');
}

原生 SQL 语句

select * from information_schema.columns where table_schema='db' table_name='user'

SourceTree 跳过注册方法

安装 SourceTree

然后打开本地文件夹

%LocalAppData%\Atlassian\SourceTree\

当前文件夹下创建一个 json 文件,文件名为 accounts.json

[
  {
    "$id": "1",
    "$type": "SourceTree.Api.Host.Identity.Model.IdentityAccount, SourceTree.Api.Host.Identity",
    "Authenticate": true,
    "HostInstance": {
      "$id": "2",
      "$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountInstance, SourceTree.Host.AtlassianAccount",
      "Host": {
        "$id": "3",
        "$type": "SourceTree.Host.Atlassianaccount.AtlassianAccountHost, SourceTree.Host.AtlassianAccount",
        "Id": "atlassian account"
      },
      "BaseUrl": "https://id.atlassian.com/"
    },
    "Credentials": {
      "$id": "4",
      "$type": "SourceTree.Model.BasicAuthCredentials, SourceTree.Api.Account",
      "Username": "",
      "Email": null
    },
    "IsDefault": false
  }
]

重启 SourceTree

CentOS 7 修改 yum 源为 阿里云

备份本地 yum 源

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak

获取阿里 yum 源配置文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

清理一下旧包

yum clean all

更新 cache  生成缓存

yum makecache

更新(如果需要)

yum -y update 

React Native 提示 Could not determine java version from ’11’

报错

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11'.

React Native 无法使用 Java 11,需使用 Java 8

卸载 Java 11,Windows 用户可使用 设置里的 应用与功能卸载 JDK 11

下载安装 Java 8

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

配置系统变量或用户变量 JAVA_HOME 为

C:\Program Files\Java\jdk1.8.0_181

具体根据你的安装目录决定

然后重新 react-native run-android

done!

Android Studio 无法启动 Emulator 模拟器

错误提示

20:41	Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!

20:41	Emulator: Process finished with exit code 1

打开  SDK Manager 下载 intel haxm,下载位置:android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe

运行 IntelHaxm.exe安装

安装完成后 命令行执行命令  sc query intelhaxm

如果 STATE RUNNING 表示安装成功 。

如果有错误提示, 一般因为 BIOS 里面没有开启 Virtualization Technology,开启即可

然后  打开 SDK Manager 下载 intel x86 镜像创建 AVD,CPU选择 intel atom x86

成功开启