diff --git a/database/migrations/20221013031925_system_auth.php b/database/migrations/20221013031925_system_auth.php index b04e3046b..f81a3c01c 100644 --- a/database/migrations/20221013031925_system_auth.php +++ b/database/migrations/20221013031925_system_auth.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemAuth extends Migrator { - protected $name = 'system_auth'; + private $name = 'system_auth'; public function change() { @@ -19,7 +19,7 @@ class SystemAuth extends Migrator ->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' => 20, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) ->addIndex('sort', ['name' => 'idx_system_auth_sort']) ->addIndex('title', ['name' => 'idx_system_auth_title']) diff --git a/database/migrations/20221013032309_system_auth_node.php b/database/migrations/20221013032309_system_auth_node.php index c66bbe1ce..702b1d25e 100644 --- a/database/migrations/20221013032309_system_auth_node.php +++ b/database/migrations/20221013032309_system_auth_node.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemAuthNode extends Migrator { - protected $name = 'system_auth_node'; + private $name = 'system_auth_node'; public function change() { diff --git a/database/migrations/20221013032525_system_base.php b/database/migrations/20221013032525_system_base.php index 924e255ff..1073b2c2a 100644 --- a/database/migrations/20221013032525_system_base.php +++ b/database/migrations/20221013032525_system_base.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemBase extends Migrator { - protected $name = 'system_base'; + private $name = 'system_base'; public function change() { @@ -20,8 +20,8 @@ class SystemBase extends Migrator ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '数据名称']) ->addColumn('content', 'text', ['limit' => 500, 'default' => '', 'comment' => '数据内容']) ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('deleted', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '删除(0正常,1已删)']) + ->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' => '删除用户']) ->addIndex('type', ['name' => 'idx_system_base_type']) diff --git a/database/migrations/20221013033419_system_config.php b/database/migrations/20221013033419_system_config.php index 8080252b9..a3e80291e 100644 --- a/database/migrations/20221013033419_system_config.php +++ b/database/migrations/20221013033419_system_config.php @@ -7,19 +7,47 @@ use think\migration\Migrator; */ class SystemConfig extends Migrator { - protected $name = 'system_config'; + private $name = 'system_config'; public function change() { // 创建数据表 - $this->table($this->name, [ + $table = $this->table($this->name, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-配置', - ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '配置分类']) + ]); + $table->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '配置分类']) ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '配置名称']) ->addColumn('value', 'string', ['limit' => 2048, 'default' => '', 'comment' => '配置内容']) ->addIndex('type', ['name' => 'idx_system_config_type']) ->addIndex('name', ['name' => 'idx_system_config_name']) ->save(); + + // 初始化配置信息 + $this->execute(<<name} VALUES (1, 'base', 'app_name', 'ThinkAdmin'); +INSERT INTO {$this->name} VALUES (2, 'base', 'app_version', 'v6'); +INSERT INTO {$this->name} VALUES (3, 'base', 'beian', ''); +INSERT INTO {$this->name} VALUES (4, 'base', 'editor', 'ckeditor5'); +INSERT INTO {$this->name} VALUES (5, 'base', 'login_image', ''); +INSERT INTO {$this->name} VALUES (6, 'base', 'login_name', '系统管理'); +INSERT INTO {$this->name} VALUES (7, 'base', 'miitbeian', ''); +INSERT INTO {$this->name} VALUES (8, 'base', 'site_copy', '©版权所有 2014-2022 楚才科技'); +INSERT INTO {$this->name} VALUES (9, 'base', 'site_host', ''); +INSERT INTO {$this->name} VALUES (10, 'base', 'site_icon', 'https://v6.thinkadmin.top/upload/4b/5a423974e447d5502023f553ed370f.png'); +INSERT INTO {$this->name} VALUES (11, 'base', 'site_name', 'ThinkAdmin'); +INSERT INTO {$this->name} VALUES (12, 'base', 'site_theme', 'default'); +INSERT INTO {$this->name} VALUES (13, 'base', 'xpath', 'admin'); +INSERT INTO {$this->name} VALUES (14, 'storage', 'alioss_http_protocol', 'http'); +INSERT INTO {$this->name} VALUES (15, 'storage', 'allow_exts', 'doc,gif,ico,jpg,mp3,mp4,p12,pem,png,zip,rar,xls,xlsx'); +INSERT INTO {$this->name} VALUES (16, 'storage', 'link_type', 'none'); +INSERT INTO {$this->name} VALUES (17, 'storage', 'local_http_domain', ''); +INSERT INTO {$this->name} VALUES (18, 'storage', 'local_http_protocol', 'follow'); +INSERT INTO {$this->name} VALUES (19, 'storage', 'name_type', 'xmd5'); +INSERT INTO {$this->name} VALUES (20, 'storage', 'type', 'local'); +INSERT INTO {$this->name} VALUES (21, 'wechat', 'type', 'api'); +INSERT INTO {$this->name} VALUES (22, 'storage', 'qiniu_http_protocol', 'http'); +SQL + ); + } } diff --git a/database/migrations/20221013033914_system_data.php b/database/migrations/20221013033914_system_data.php index 7ed186676..81ad2bd12 100644 --- a/database/migrations/20221013033914_system_data.php +++ b/database/migrations/20221013033914_system_data.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemData extends Migrator { - protected $name = 'system_data'; + private $name = 'system_data'; public function change() { diff --git a/database/migrations/20221013034059_system_file.php b/database/migrations/20221013034059_system_file.php index cd8475d23..3e08bf34a 100644 --- a/database/migrations/20221013034059_system_file.php +++ b/database/migrations/20221013034059_system_file.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemFile extends Migrator { - protected $name = 'system_file'; + private $name = 'system_file'; public function change() { @@ -24,8 +24,8 @@ class SystemFile extends Migrator ->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件类型']) ->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文件大小']) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户编号']) - ->addColumn('isfast', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '是否秒传']) - ->addColumn('status', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否秒传']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) ->addColumn('create_at', 'datetime', ['limit' => 20, 'default' => '', 'comment' => '创建时间']) ->addColumn('update_at', 'datetime', ['limit' => 20, 'default' => 0, 'comment' => '更新时间']) ->addIndex('type', ['name' => 'idx_system_file_type']) diff --git a/database/migrations/20221013034618_system_menu.php b/database/migrations/20221013034618_system_menu.php index 21e3f7407..6d9d7996b 100644 --- a/database/migrations/20221013034618_system_menu.php +++ b/database/migrations/20221013034618_system_menu.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemMenu extends Migrator { - protected $name = 'system_menu'; + private $name = 'system_menu'; public function change() { @@ -23,7 +23,7 @@ class SystemMenu extends Migrator ->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'comment' => '链接参数']) ->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'comment' => '打开方式']) ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 20, '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']) @@ -32,51 +32,51 @@ class SystemMenu extends Migrator // 初始化菜单数据 $this->execute(<<name}` VALUES (1, 0, '控制台', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (2, 1, '数据管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (3, 2, '数据统计报表', 'layui-icon layui-icon-theme', 'data/total.portal/index', 'data/total.portal/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (4, 2, '轮播图片管理', 'layui-icon layui-icon-carousel', 'data/base.slider/index', 'data/base.slider/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (5, 2, '页面内容管理', 'layui-icon layui-icon-read', 'data/base.pager/index', 'data/base.pager/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (6, 2, '文章内容管理', 'layui-icon layui-icon-template', 'data/news.item/index', 'data/news.item/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (7, 2, '支付参数管理', 'layui-icon layui-icon-rmb', 'data/base.payment/index', 'data/base.payment/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (8, 2, '系统通知管理', 'layui-icon layui-icon-notice', 'data/base.message/index', 'data/base.message/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (9, 2, '微信小程序配置', 'layui-icon layui-icon-set', 'data/base.config/wxapp', 'data/base.config/wxapp', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (10, 2, '邀请二维码设置', 'layui-icon layui-icon-cols', 'data/base.config/cropper', 'data/base.config/cropper', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (11, 1, '用户管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (12, 11, '会员用户管理', 'layui-icon layui-icon-user', 'data/user.admin/index', 'data/user.admin/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (13, 11, '余额充值管理', 'layui-icon layui-icon-rmb', 'data/user.balance/index', 'data/user.balance/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (14, 11, '用户返利管理', 'layui-icon layui-icon-transfer', 'data/user.rebate/index', 'data/user.rebate/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (15, 11, '用户提现管理', 'layui-icon layui-icon-component', 'data/user.transfer/index', 'data/user.transfer/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (16, 11, '用户等级管理', 'layui-icon layui-icon-senior', 'data/base.upgrade/index', 'data/base.upgrade/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (17, 11, '用户折扣方案', 'layui-icon layui-icon-set', 'data/base.discount/index', 'data/base.discount/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (18, 1, '商城管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (19, 18, '商品数据管理', 'layui-icon layui-icon-star', 'data/shop.goods/index', 'data/shop.goods/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (20, 18, '商品分类管理', 'layui-icon layui-icon-tabs', 'data/shop.cate/index', 'data/shop.cate/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (21, 18, '订单数据管理', 'layui-icon layui-icon-template', 'data/shop.order/index', 'data/shop.order/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (22, 18, '订单发货管理', 'layui-icon layui-icon-transfer', 'data/shop.send/index', 'data/shop.send/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (23, 18, '快递公司管理', 'layui-icon layui-icon-website', 'data/base.postage.company/index', 'data/base.postage.company/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (24, 18, '邮费模板管理', 'layui-icon layui-icon-template-1', 'data/base.postage.template/index', 'data/base.postage.template/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (25, 0, '微信管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (26, 25, '微信管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (27, 26, '微信接口配置', 'layui-icon layui-icon-set', '', 'wechat/config/options', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (28, 26, '微信支付配置', 'layui-icon layui-icon-rmb', '', 'wechat/config/payment', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (29, 25, '微信定制', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (30, 29, '微信粉丝管理', 'layui-icon layui-icon-username', '', 'wechat/fans/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (31, 29, '微信菜单配置', 'layui-icon layui-icon-cellphone', '', 'wechat/menu/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (32, 29, '微信图文管理', 'layui-icon layui-icon-template-1', '', 'wechat/news/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (33, 29, '回复规则管理', 'layui-icon layui-icon-engine', '', 'wechat/keys/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (34, 29, '关注自动回复', 'layui-icon layui-icon-release', 'wechat/auto/index', 'wechat/auto/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (35, 0, '系统管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (36, 35, '系统配置', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (37, 36, '系统参数配置', 'layui-icon layui-icon-set', '', 'admin/config/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (38, 36, '系统任务管理', 'layui-icon layui-icon-log', '', 'admin/queue/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (39, 36, '系统日志管理', 'layui-icon layui-icon-form', '', 'admin/oplog/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (40, 36, '数据字典管理', 'layui-icon layui-icon-code-circle', 'admin/base/index', 'admin/base/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (41, 36, '系统文件管理', 'layui-icon layui-icon-carousel', 'admin/file/index', 'admin/file/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (42, 36, '系统菜单管理', 'layui-icon layui-icon-layouts', '', 'admin/menu/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (43, 35, '权限管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (44, 43, '访问权限管理', 'layui-icon layui-icon-vercode', '', 'admin/auth/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); -INSERT INTO `{$this->name}` VALUES (45, 43, '系统用户管理', 'layui-icon layui-icon-username', '', 'admin/user/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (1, 0, '控制台', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (2, 1, '数据管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (3, 2, '数据统计报表', 'layui-icon layui-icon-theme', 'data/total.portal/index', 'data/total.portal/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (4, 2, '轮播图片管理', 'layui-icon layui-icon-carousel', 'data/base.slider/index', 'data/base.slider/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (5, 2, '页面内容管理', 'layui-icon layui-icon-read', 'data/base.pager/index', 'data/base.pager/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (6, 2, '文章内容管理', 'layui-icon layui-icon-template', 'data/news.item/index', 'data/news.item/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (7, 2, '支付参数管理', 'layui-icon layui-icon-rmb', 'data/base.payment/index', 'data/base.payment/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (8, 2, '系统通知管理', 'layui-icon layui-icon-notice', 'data/base.message/index', 'data/base.message/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (9, 2, '微信小程序配置', 'layui-icon layui-icon-set', 'data/base.config/wxapp', 'data/base.config/wxapp', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (10, 2, '邀请二维码设置', 'layui-icon layui-icon-cols', 'data/base.config/cropper', 'data/base.config/cropper', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (11, 1, '用户管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (12, 11, '会员用户管理', 'layui-icon layui-icon-user', 'data/user.admin/index', 'data/user.admin/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (13, 11, '余额充值管理', 'layui-icon layui-icon-rmb', 'data/user.balance/index', 'data/user.balance/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (14, 11, '用户返利管理', 'layui-icon layui-icon-transfer', 'data/user.rebate/index', 'data/user.rebate/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (15, 11, '用户提现管理', 'layui-icon layui-icon-component', 'data/user.transfer/index', 'data/user.transfer/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (16, 11, '用户等级管理', 'layui-icon layui-icon-senior', 'data/base.upgrade/index', 'data/base.upgrade/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (17, 11, '用户折扣方案', 'layui-icon layui-icon-set', 'data/base.discount/index', 'data/base.discount/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (18, 1, '商城管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (19, 18, '商品数据管理', 'layui-icon layui-icon-star', 'data/shop.goods/index', 'data/shop.goods/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (20, 18, '商品分类管理', 'layui-icon layui-icon-tabs', 'data/shop.cate/index', 'data/shop.cate/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (21, 18, '订单数据管理', 'layui-icon layui-icon-template', 'data/shop.order/index', 'data/shop.order/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (22, 18, '订单发货管理', 'layui-icon layui-icon-transfer', 'data/shop.send/index', 'data/shop.send/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (23, 18, '快递公司管理', 'layui-icon layui-icon-website', 'data/base.postage.company/index', 'data/base.postage.company/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (24, 18, '邮费模板管理', 'layui-icon layui-icon-template-1', 'data/base.postage.template/index', 'data/base.postage.template/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (25, 0, '微信管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (26, 25, '微信管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (27, 26, '微信接口配置', 'layui-icon layui-icon-set', '', 'wechat/config/options', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (28, 26, '微信支付配置', 'layui-icon layui-icon-rmb', '', 'wechat/config/payment', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (29, 25, '微信定制', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (30, 29, '微信粉丝管理', 'layui-icon layui-icon-username', '', 'wechat/fans/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (31, 29, '微信菜单配置', 'layui-icon layui-icon-cellphone', '', 'wechat/menu/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (32, 29, '微信图文管理', 'layui-icon layui-icon-template-1', '', 'wechat/news/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (33, 29, '回复规则管理', 'layui-icon layui-icon-engine', '', 'wechat/keys/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (34, 29, '关注自动回复', 'layui-icon layui-icon-release', 'wechat/auto/index', 'wechat/auto/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (35, 0, '系统管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (36, 35, '系统配置', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (37, 36, '系统参数配置', 'layui-icon layui-icon-set', '', 'admin/config/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (38, 36, '系统任务管理', 'layui-icon layui-icon-log', '', 'admin/queue/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (39, 36, '系统日志管理', 'layui-icon layui-icon-form', '', 'admin/oplog/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (40, 36, '数据字典管理', 'layui-icon layui-icon-code-circle', 'admin/base/index', 'admin/base/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (41, 36, '系统文件管理', 'layui-icon layui-icon-carousel', 'admin/file/index', 'admin/file/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (42, 36, '系统菜单管理', 'layui-icon layui-icon-layouts', '', 'admin/menu/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (43, 35, '权限管理', '', '', '#', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (44, 43, '访问权限管理', 'layui-icon layui-icon-vercode', '', 'admin/auth/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); +INSERT INTO {$this->name} VALUES (45, 43, '系统用户管理', 'layui-icon layui-icon-username', '', 'admin/user/index', '', '_self', 0, 1, '2022-10-13 12:19:45'); SQL ); } diff --git a/database/migrations/20221013045619_system_queue.php b/database/migrations/20221013045619_system_queue.php index ac5b20aa8..8bc32a6e6 100644 --- a/database/migrations/20221013045619_system_queue.php +++ b/database/migrations/20221013045619_system_queue.php @@ -25,7 +25,7 @@ class SystemQueue extends Migrator ->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '循环时间']) ->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行次数']) ->addColumn('rscript', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '任务类型(0单例,1多例)']) - ->addColumn('status', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_system_queue_code']) ->addIndex('title', ['name' => 'idx_system_queue_title']) diff --git a/database/migrations/20221013045828_system_user.php b/database/migrations/20221013045828_system_user.php index 03b20058c..30afe6011 100644 --- a/database/migrations/20221013045828_system_user.php +++ b/database/migrations/20221013045828_system_user.php @@ -7,7 +7,7 @@ use think\migration\Migrator; */ class SystemUser extends Migrator { - protected $name = 'system_user'; + private $name = 'system_user'; public function change() { @@ -29,9 +29,9 @@ class SystemUser extends Migrator ->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '登录时间']) ->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录次数']) ->addColumn('describe', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明']) - ->addColumn('status', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('is_deleted', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '删除(1删除,0未删)']) + ->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']) ->addIndex('username', ['name' => 'idx_system_user_username']) diff --git a/database/migrations/20221013045828_wechat_auto.php b/database/migrations/20221013045828_wechat_auto.php new file mode 100644 index 000000000..b85e4d051 --- /dev/null +++ b/database/migrations/20221013045828_wechat_auto.php @@ -0,0 +1,43 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-回复', + ]); + $table + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) + ->addColumn('time', 'string', ['limit' => 50, 'default' => '', 'comment' => '延迟时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '消息编号']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号编号']) + ->addColumn('content', 'text', ['default' => '', 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 500, 'default' => '', 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频链接']) + ->addColumn('video_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文编号']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addIndex('code', ['name' => 'idx_wechat_auto_code']) + ->addIndex('type', ['name' => 'idx_wechat_auto_type']) + ->addIndex('time', ['name' => 'idx_wechat_auto_time']) + ->addIndex('appid', ['name' => 'idx_wechat_auto_appid']) + ->addIndex('status', ['name' => 'idx_wechat_auto_status']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_fans.php b/database/migrations/20221013045828_wechat_fans.php new file mode 100644 index 000000000..ad2cc736c --- /dev/null +++ b/database/migrations/20221013045828_wechat_fans.php @@ -0,0 +1,46 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-粉丝', + ]); + $table + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号编号']) + ->addColumn('unionid', 'string', ['limit' => 100, 'default' => '', 'comment' => 'UNIONID']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => 'OPENID']) + ->addColumn('tagid_list', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝标签']) + ->addColumn('is_black', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '黑名单状态']) + ->addColumn('subscribe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '黑名单状态']) + ->addColumn('nickname', 'string', ['limit' => 200, 'default' => '', 'comment' => '用户昵称']) + ->addColumn('sex', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '用户性别(1男性,2女性,0未知)']) + ->addColumn('country', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在国家']) + ->addColumn('province', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在省份']) + ->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在城市']) + ->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户的语言']) + ->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像']) + ->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '关注时间']) + ->addColumn('subscribe_at', 'datetime', ['limit' => 20, 'default' => null, 'comment' => '关注时间']) + ->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'comment' => '扫码场景']) + ->addColumn('qr_scene', 'string', ['limit' => 200, 'default' => '', 'comment' => '场景数值']) + ->addColumn('qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'comment' => '场景内容']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户备注']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addIndex('appid', ['name' => 'idx_wechat_fans_appid']) + ->addIndex('openid', ['name' => 'idx_wechat_fans_openid']) + ->addIndex('unionid', ['name' => 'idx_wechat_fans_unionid']) + ->addIndex('is_black', ['name' => 'idx_wechat_fans_black']) + ->addIndex('subscribe', ['name' => 'idx_wechat_fans_subscribe']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_fans_tags.php b/database/migrations/20221013045828_wechat_fans_tags.php new file mode 100644 index 000000000..84923b4f0 --- /dev/null +++ b/database/migrations/20221013045828_wechat_fans_tags.php @@ -0,0 +1,27 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签', + ]); + $table + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号编号']) + ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '标签名称']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => 'OPENID']) + ->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '粉丝数量']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addIndex('appid', ['name' => 'idx_wechat_fans_appid']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_keys.php b/database/migrations/20221013045828_wechat_keys.php new file mode 100644 index 000000000..564d6aa96 --- /dev/null +++ b/database/migrations/20221013045828_wechat_keys.php @@ -0,0 +1,45 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-规则', + ]); + $table + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) + ->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'comment' => '关键字']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号编号']) + ->addColumn('content', 'text', ['default' => '', 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 500, 'default' => '', 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频链接']) + ->addColumn('video_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文编号']) + ->addColumn('sort', 'integer', ['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_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addIndex('sort', ['name' => 'idx_wechat_keys_sort']) + ->addIndex('keys', ['name' => 'idx_wechat_keys_keys']) + ->addIndex('type', ['name' => 'idx_wechat_keys_type']) + ->addIndex('time', ['name' => 'idx_wechat_keys_time']) + ->addIndex('appid', ['name' => 'idx_wechat_keys_appid']) + ->addIndex('status', ['name' => 'idx_wechat_keys_status']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_media.php b/database/migrations/20221013045828_wechat_media.php new file mode 100644 index 000000000..1a41ee445 --- /dev/null +++ b/database/migrations/20221013045828_wechat_media.php @@ -0,0 +1,32 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-素材', + ]); + $table + ->addColumn('md5', 'string', ['limit' => 32, 'default' => '', 'comment' => '文件哈希']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '媒体类型']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号编号']) + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID']) + ->addColumn('local_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '本地文件链接']) + ->addColumn('media_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '远程图片链接']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->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_id']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_news.php b/database/migrations/20221013045828_wechat_news.php new file mode 100644 index 000000000..9181782b3 --- /dev/null +++ b/database/migrations/20221013045828_wechat_news.php @@ -0,0 +1,30 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文', + ]); + $table + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材编号']) + ->addColumn('local_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '本地文件链接']) + ->addColumn('article_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '关联文章编号(用英文逗号做分割)']) + ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除(1删除,0未删)']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建用户']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addIndex('media_id', ['name' => 'idx_wechat_news_media_id']) + ->addIndex('article_id', ['name' => 'idx_wechat_news_article_id']) + ->addIndex('is_deleted', ['name' => 'idx_wechat_news_deleted']) + ->save(); + } +} diff --git a/database/migrations/20221013045828_wechat_news_article.php b/database/migrations/20221013045828_wechat_news_article.php new file mode 100644 index 000000000..d269ac742 --- /dev/null +++ b/database/migrations/20221013045828_wechat_news_article.php @@ -0,0 +1,30 @@ +table($this->name, [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', + ]); + $table + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '素材标题']) + ->addColumn('local_url', 'string', ['limit' => 500, 'default' => '', 'comment' => '素材链接']) + ->addColumn('show_cover_pic', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '显示封面(0隐藏,1显示)']) + ->addColumn('author', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章作者']) + ->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'comment' => '摘要内容']) + ->addColumn('content', 'text', ['default' => '', 'comment' => '图文内容']) + ->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'comment' => '原文地址']) + ->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读数量']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->save(); + } +}