所以自己也写了一个简单的
composer require qmq/tp6
```
3. 命令的使用
- php think 查看
```
qmq
qmq:model 创建模型
```
- php think qmq:model -h
```
Usage:
model:create [options] [--] <name> [<space>]
model:create 生成模型 获取数据库字段与备注
Arguments:
name 模型名称
space 命名空间[\\分隔 app\\admin] [default: "app"]
Options:
-s, --suffix[=SUFFIX] 模型后缀 false代表没有后缀 [default: "Model"]
-r, --reset 覆盖已有模型
-h, --help Display this help message
-V, --version Display this console version
-q, --quiet Do not output any message
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```
4. 使用示例 请先配置数据库连接(目前只支持mysql)
```
php think qmq:model 表名 模型命名空间
php think qmq:model log app\\admin
```
5. 生成的示例
```
<?php
namespace app\admin\model;
use think\Model;
/**
* 这个模型类来自表 tp6_log
*
* 日志表 2019-12-25 01:26:44
* 模型生成时间 2020-01-03 10:16:47
*
* @property int $id
* @property int $uid 产生日志的用户
* @property string $ti
* @property int $type 日志类型 1:模型日志 2:操作日志 默认值 1
* @property string $before 变更前数据
* @property string $after 变更后数据
* @property int $create_time 创建时间
*/
class LogModel extends Model{
}
```
