mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-06 08:11:12 +08:00
Compare commits
3 Commits
ef9f90288d
...
2cd8bd973a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cd8bd973a | ||
|
|
790e0799ba | ||
|
|
eccba878bb |
@ -9,69 +9,119 @@ class InstallAdmin extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
$this->_auth();
|
||||
$this->_base();
|
||||
$this->_conf();
|
||||
$this->_data();
|
||||
$this->_file();
|
||||
$this->_menu();
|
||||
$this->_node();
|
||||
$this->_oplog();
|
||||
$this->_queue();
|
||||
$this->_user();
|
||||
$this->_create_system_auth();
|
||||
$this->_create_system_auth_node();
|
||||
$this->_create_system_base();
|
||||
$this->_create_system_config();
|
||||
$this->_create_system_data();
|
||||
$this->_create_system_file();
|
||||
$this->_create_system_menu();
|
||||
$this->_create_system_oplog();
|
||||
$this->_create_system_queue();
|
||||
$this->_create_system_user();
|
||||
}
|
||||
|
||||
private function _auth()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemAuth
|
||||
* @table system_auth
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_auth()
|
||||
{
|
||||
// 当前操作
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_auth';
|
||||
|
||||
// 创建数据表,存在则跳过
|
||||
$this->hasTable($table) || $this->table($table, [
|
||||
// 存在则跳过
|
||||
if ($this->hasTable($table)) return;
|
||||
|
||||
// 创建数据表
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-权限',
|
||||
])
|
||||
->addColumn('title', 'string', ['limit' => 80, 'default' => '', 'comment' => '权限名称'])
|
||||
->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '权限名称'])
|
||||
->addColumn('utype', 'string', ['limit' => 50, 'default' => '', 'comment' => '身份权限'])
|
||||
->addColumn('desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明'])
|
||||
->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('sort', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '权限状态(1使用,0禁用)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('sort', ['name' => 'idx_system_auth_sort'])
|
||||
->addIndex('title', ['name' => 'idx_system_auth_title'])
|
||||
->addIndex('status', ['name' => 'idx_system_auth_status'])
|
||||
->addIndex('title', ['name' => 'idx_system_auth_title'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _base()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemAuthNode
|
||||
* @table system_auth_node
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_auth_node()
|
||||
{
|
||||
// 当前操作
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_auth_node';
|
||||
|
||||
// 存在则跳过
|
||||
if ($this->hasTable($table)) return;
|
||||
|
||||
// 创建数据表
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权',
|
||||
])
|
||||
->addColumn('auth', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '角色'])
|
||||
->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '节点'])
|
||||
->addIndex('auth', ['name' => 'idx_system_auth_node_auth'])
|
||||
->addIndex('node', ['name' => 'idx_system_auth_node_node'])
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemBase
|
||||
* @table system_base
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_base()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_base';
|
||||
|
||||
// 创建数据表,存在则跳过
|
||||
$this->hasTable($table) || $this->table($table, [
|
||||
// 存在则跳过
|
||||
if ($this->hasTable($table)) return;
|
||||
|
||||
// 创建数据表
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-字典',
|
||||
])
|
||||
->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '数据类型'])
|
||||
->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '数据代码'])
|
||||
->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '数据名称'])
|
||||
->addColumn('content', 'text', ['default' => '', 'comment' => '数据内容'])
|
||||
->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除(0正常,1已删)'])
|
||||
->addColumn('content', 'text', ['default' => null, 'comment' => '数据内容'])
|
||||
->addColumn('sort', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '数据状态(0禁用,1启动)'])
|
||||
->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0正常,1已删)'])
|
||||
->addColumn('deleted_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '删除时间'])
|
||||
->addColumn('deleted_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '删除用户'])
|
||||
->addColumn('deleted_by', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '删除用户'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('type', ['name' => 'idx_system_base_type'])
|
||||
->addIndex('code', ['name' => 'idx_system_base_code'])
|
||||
->addIndex('name', ['name' => 'idx_system_base_name'])
|
||||
->addIndex('sort', ['name' => 'idx_system_base_sort'])
|
||||
->addIndex('status', ['name' => 'idx_system_base_status'])
|
||||
->addIndex('deleted', ['name' => 'idx_system_base_deleted'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _conf()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemConfig
|
||||
* @table system_config
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_config()
|
||||
{
|
||||
// 当前操作
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_config';
|
||||
|
||||
// 存在则跳过
|
||||
@ -89,8 +139,15 @@ class InstallAdmin extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _data()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemData
|
||||
* @table system_data
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_data()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_data';
|
||||
|
||||
@ -107,8 +164,15 @@ class InstallAdmin extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _file()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemFile
|
||||
* @table system_file
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_file()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_file';
|
||||
|
||||
@ -126,8 +190,8 @@ class InstallAdmin extends Migrator
|
||||
->addColumn('xurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '访问链接'])
|
||||
->addColumn('xkey', 'string', ['limit' => 500, 'default' => '', 'comment' => '文件路径'])
|
||||
->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件类型'])
|
||||
->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文件大小'])
|
||||
->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户编号'])
|
||||
->addColumn('size', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '文件大小'])
|
||||
->addColumn('uuid', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '用户编号'])
|
||||
->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否秒传'])
|
||||
->addColumn('issafe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '安全模式'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '上传状态(1悬空,2落地)'])
|
||||
@ -143,8 +207,15 @@ class InstallAdmin extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _menu()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemMenu
|
||||
* @table system_menu
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_menu()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_menu';
|
||||
|
||||
@ -155,7 +226,7 @@ class InstallAdmin extends Migrator
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-菜单',
|
||||
])
|
||||
->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级ID'])
|
||||
->addColumn('pid', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '上级ID'])
|
||||
->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单名称'])
|
||||
->addColumn('icon', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单图标'])
|
||||
->addColumn('node', 'string', ['limit' => 100, 'default' => '', 'comment' => '节点代码'])
|
||||
@ -163,32 +234,21 @@ class InstallAdmin extends Migrator
|
||||
->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'comment' => '链接参数'])
|
||||
->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'comment' => '打开方式'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('pid', ['name' => 'idx_system_menu_pid'])
|
||||
->addIndex('sort', ['name' => 'idx_system_menu_sort'])
|
||||
->addIndex('status', ['name' => 'idx_system_menu_status'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _node()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemOplog
|
||||
* @table system_oplog
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_oplog()
|
||||
{
|
||||
// 当前操作
|
||||
$table = 'system_auth_node';
|
||||
|
||||
// 创建数据表,存在则跳过
|
||||
$this->hasTable($table) || $this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权',
|
||||
])
|
||||
->addColumn('auth', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '角色编号'])
|
||||
->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '节点路径'])
|
||||
->addIndex('auth', ['name' => 'idx_system_auth_node_auth'])
|
||||
->addIndex('node', ['name' => 'idx_system_auth_node_node'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _oplog()
|
||||
{
|
||||
// 当前数据表
|
||||
$table = 'system_oplog';
|
||||
|
||||
@ -208,8 +268,15 @@ class InstallAdmin extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _queue()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemQueue
|
||||
* @table system_queue
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_queue()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_queue';
|
||||
|
||||
@ -223,14 +290,14 @@ class InstallAdmin extends Migrator
|
||||
->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '任务编号'])
|
||||
->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '任务名称'])
|
||||
->addColumn('command', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行指令'])
|
||||
->addColumn('exec_pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行进程'])
|
||||
->addColumn('exec_pid', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '执行进程'])
|
||||
->addColumn('exec_data', 'text', ['default' => null, 'comment' => '执行参数'])
|
||||
->addColumn('exec_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行时间'])
|
||||
->addColumn('exec_time', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '执行时间'])
|
||||
->addColumn('exec_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行描述'])
|
||||
->addColumn('enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '开始时间'])
|
||||
->addColumn('outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '结束时间'])
|
||||
->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '循环时间'])
|
||||
->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行次数'])
|
||||
->addColumn('loops_time', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '循环时间'])
|
||||
->addColumn('attempts', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '执行次数'])
|
||||
->addColumn('rscript', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务类型(0单例,1多例)'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
@ -238,13 +305,20 @@ class InstallAdmin extends Migrator
|
||||
->addIndex('title', ['name' => 'idx_system_queue_title'])
|
||||
->addIndex('status', ['name' => 'idx_system_queue_status'])
|
||||
->addIndex('rscript', ['name' => 'idx_system_queue_rscript'])
|
||||
->addIndex('exec_time', ['name' => 'idx_system_queue_exec_time'])
|
||||
->addIndex('create_at', ['name' => 'idx_system_queue_create_at'])
|
||||
->addIndex('exec_time', ['name' => 'idx_system_queue_exec_time'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _user()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class SystemUser
|
||||
* @table system_user
|
||||
* @return void
|
||||
*/
|
||||
private function _create_system_user()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'system_user';
|
||||
|
||||
@ -262,14 +336,14 @@ class InstallAdmin extends Migrator
|
||||
->addColumn('headimg', 'string', ['limit' => 255, 'default' => '', 'comment' => '头像地址'])
|
||||
->addColumn('authorize', 'string', ['limit' => 255, 'default' => '', 'comment' => '权限授权'])
|
||||
->addColumn('contact_qq', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系QQ'])
|
||||
->addColumn('contact_mail', 'string', ['limit' => 50, 'default' => '', 'comment' => '联系邮箱'])
|
||||
->addColumn('contact_phone', 'string', ['limit' => 50, 'default' => '', 'comment' => '联系手机'])
|
||||
->addColumn('contact_mail', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系邮箱'])
|
||||
->addColumn('contact_phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系手机'])
|
||||
->addColumn('login_ip', 'string', ['limit' => 255, 'default' => '', 'comment' => '登录地址'])
|
||||
->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '登录时间'])
|
||||
->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录次数'])
|
||||
->addColumn('login_num', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '登录次数'])
|
||||
->addColumn('describe', 'string', ['limit' => 255, 'default' => '', 'comment' => '备注说明'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('sort', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '排序权重'])
|
||||
->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除(1删除,0未删)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('status', ['name' => 'idx_system_user_status'])
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -9,17 +9,25 @@ class InstallWechat extends Migrator
|
||||
{
|
||||
public function change()
|
||||
{
|
||||
$this->_auto();
|
||||
$this->_fans();
|
||||
$this->_tags();
|
||||
$this->_keys();
|
||||
$this->_news();
|
||||
$this->_media();
|
||||
$this->_article();
|
||||
$this->_create_wechat_auto();
|
||||
$this->_create_wechat_fans();
|
||||
$this->_create_wechat_fans_tags();
|
||||
$this->_create_wechat_keys();
|
||||
$this->_create_wechat_media();
|
||||
$this->_create_wechat_news();
|
||||
$this->_create_wechat_news_article();
|
||||
}
|
||||
|
||||
private function _auto()
|
||||
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatAuto
|
||||
* @table wechat_auto
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_auto()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_auto';
|
||||
|
||||
@ -44,9 +52,9 @@ class InstallWechat extends Migrator
|
||||
->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题'])
|
||||
->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL'])
|
||||
->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述'])
|
||||
->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID'])
|
||||
->addColumn('news_id', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '图文ID'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addColumn('create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('type', ['name' => 'idx_wechat_auto_type'])
|
||||
->addIndex('time', ['name' => 'idx_wechat_auto_time'])
|
||||
@ -55,8 +63,15 @@ class InstallWechat extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _fans()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatFans
|
||||
* @table wechat_fans
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_fans()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_fans';
|
||||
|
||||
@ -80,7 +95,7 @@ class InstallWechat extends Migrator
|
||||
->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在城市'])
|
||||
->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户的语言(zh_CN)'])
|
||||
->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像'])
|
||||
->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '关注时间'])
|
||||
->addColumn('subscribe_time', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '关注时间'])
|
||||
->addColumn('subscribe_at', 'datetime', ['default' => null, 'comment' => '关注时间'])
|
||||
->addColumn('remark', 'string', ['limit' => 50, 'default' => '', 'comment' => '备注'])
|
||||
->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'comment' => '扫码关注场景'])
|
||||
@ -94,8 +109,15 @@ class InstallWechat extends Migrator
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _tags()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatFansTags
|
||||
* @table wechat_fans_tags
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_fans_tags()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_fans_tags';
|
||||
|
||||
@ -107,16 +129,23 @@ class InstallWechat extends Migrator
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签',
|
||||
])
|
||||
->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号APPID'])
|
||||
->addColumn('name', 'string', ['limit' => 35, 'default' => null, 'comment' => '标签名称'])
|
||||
->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '总数'])
|
||||
->addColumn('name', 'string', ['limit' => 35, 'default' => '', 'comment' => '标签名称'])
|
||||
->addColumn('count', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '总数'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建日期'])
|
||||
->addIndex('id', ['name' => 'idx_wechat_fans_tags_id'])
|
||||
->addIndex('appid', ['name' => 'idx_wechat_fans_tags_appid'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _keys()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatKeys
|
||||
* @table wechat_keys
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_keys()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_keys';
|
||||
|
||||
@ -129,7 +158,7 @@ class InstallWechat extends Migrator
|
||||
])
|
||||
->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID'])
|
||||
->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)'])
|
||||
->addColumn('keys', 'string', ['limit' => 100, 'default' => null, 'comment' => '关键字'])
|
||||
->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'comment' => '关键字'])
|
||||
->addColumn('content', 'text', ['default' => null, 'comment' => '文本内容'])
|
||||
->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片链接'])
|
||||
->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '语音链接'])
|
||||
@ -140,42 +169,26 @@ class InstallWechat extends Migrator
|
||||
->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题'])
|
||||
->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL'])
|
||||
->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述'])
|
||||
->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID'])
|
||||
->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序字段'])
|
||||
->addColumn('news_id', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '图文ID'])
|
||||
->addColumn('sort', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '排序字段'])
|
||||
->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)'])
|
||||
->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addColumn('create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('keys', ['name' => 'idx_wechat_keys_keys'])
|
||||
->addIndex('type', ['name' => 'idx_wechat_keys_type'])
|
||||
->addIndex('appid', ['name' => 'idx_wechat_keys_appid'])
|
||||
->addIndex('type', ['name' => 'idx_wechat_keys_type'])
|
||||
->addIndex('keys', ['name' => 'idx_wechat_keys_keys'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _news()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatMedia
|
||||
* @table wechat_media
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_media()
|
||||
{
|
||||
// 当前数据表
|
||||
$table = 'wechat_news';
|
||||
|
||||
// 存在则跳过
|
||||
if ($this->hasTable($table)) return;
|
||||
|
||||
// 创建数据表
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文',
|
||||
])
|
||||
->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID'])
|
||||
->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材外网URL'])
|
||||
->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'comment' => '关联图文ID(用英文逗号做分割)'])
|
||||
->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addIndex('media_id', ['name' => 'idx_wechat_news_media_id'])
|
||||
->addIndex('article_id', ['name' => 'idx_wechat_news_article_id'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _media()
|
||||
{
|
||||
// 当前数据表
|
||||
$table = 'wechat_media';
|
||||
|
||||
@ -193,15 +206,52 @@ class InstallWechat extends Migrator
|
||||
->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '本地文件链接'])
|
||||
->addColumn('media_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '远程图片链接'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex('appid', ['name' => 'idx_wechat_media_appid'])
|
||||
->addIndex('md5', ['name' => 'idx_wechat_media_md5'])
|
||||
->addIndex('type', ['name' => 'idx_wechat_media_type'])
|
||||
->addIndex('appid', ['name' => 'idx_wechat_media_appid'])
|
||||
->addIndex('media_id', ['name' => 'idx_wechat_media_media_id'])
|
||||
->save();
|
||||
}
|
||||
|
||||
private function _article()
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatNews
|
||||
* @table wechat_news
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_news()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_news';
|
||||
|
||||
// 存在则跳过
|
||||
if ($this->hasTable($table)) return;
|
||||
|
||||
// 创建数据表
|
||||
$this->table($table, [
|
||||
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文',
|
||||
])
|
||||
->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID'])
|
||||
->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材外网URL'])
|
||||
->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'comment' => '关联图文ID(用英文逗号做分割)'])
|
||||
->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addColumn('create_by', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '创建人'])
|
||||
->addIndex('article_id', ['name' => 'idx_wechat_news_article_id'])
|
||||
->addIndex('media_id', ['name' => 'idx_wechat_news_media_id'])
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据对象
|
||||
* @class WechatNewsArticle
|
||||
* @table wechat_news_article
|
||||
* @return void
|
||||
*/
|
||||
private function _create_wechat_news_article()
|
||||
{
|
||||
|
||||
// 当前数据表
|
||||
$table = 'wechat_news_article';
|
||||
|
||||
@ -219,7 +269,7 @@ class InstallWechat extends Migrator
|
||||
->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'comment' => '摘要内容'])
|
||||
->addColumn('content', 'text', ['default' => null, 'comment' => '图文内容'])
|
||||
->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'comment' => '原文地址'])
|
||||
->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读数量'])
|
||||
->addColumn('read_num', 'biginteger', ['limit' => 20, 'default' => 0, 'comment' => '阅读数量'])
|
||||
->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->save();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user