From 49c8de54c2601ed1be3ed950b748725450b78d39 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 24 Jun 2025 15:17:31 +0800 Subject: [PATCH] =?UTF-8?q?[notice]=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20250623000000_install_notice_table.php | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/stc/database/20250623000000_install_notice_table.php b/stc/database/20250623000000_install_notice_table.php index 2f45735..0746ba0 100644 --- a/stc/database/20250623000000_install_notice_table.php +++ b/stc/database/20250623000000_install_notice_table.php @@ -24,18 +24,18 @@ class InstallNoticeTable extends Migrator public function change() { $this->_create_notice(); + $this->_create_broadcast(); } /** * 创建数据对象 - * @class JlNoticeNotice - * @table jl_notice_notice + * @table notice_notice * @return void */ private function _create_notice() { // 创建数据表对象 - $table = $this->table('jl_notice_notice', [ + $table = $this->table('notice_notice', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '消息通知', ]); // 创建或更新数据表 @@ -51,4 +51,33 @@ class InstallNoticeTable extends Migrator ], false); } + /** + * 创建数据对象 + * @table notice_broadcast + * @return void + */ + private function _create_broadcast() + { + // 创建数据表对象 + $table = $this->table('notice_broadcast', [ + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '通知公告', + ]); + // 创建或更新数据表 + PhinxExtend::upgrade($table, [ + ['to_all', 'tinyinteger', ['limit' => 4, 'default' => 0, 'null' => false, 'comment' => '是否发送给所有人']], + ['to_depts', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '要发送的部门']], + ['to_users', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '要发送的用户']], + ['to', 'text', ['default' => NULL, 'null' => false, 'comment' => '对外的发送到']], + ['title', 'string', ['limit' => 255, 'default' => NULL, 'null' => false, 'comment' => '标题']], + ['type', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '类型']], + ['content', 'text', ['default' => NULL, 'null' => true, 'comment' => '内容']], + ['files', 'string', ['limit' => 255, 'default' => NULL, 'null' => true, 'comment' => '附件']], + ['create_at', 'datetime', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], + ['create_by', 'integer', ['limit' => 11, 'default' => 0, 'null' => false, 'comment' => '创建人ID']], + ['is_deleted', 'tinyinteger', ['limit' => 4, 'default' => 0, 'null' => false, 'comment' => '是否已删除']], + ], [ + 'type' + ], false); + } + }