cloud 1 mese fa
parent
commit
f507382712

+ 1 - 1
application/admin/view/company_info/add.html

@@ -8,7 +8,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Employee_count')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-employee_count" min="0" class="form-control" name="row[employee_count]" type="number" data-rule="required">
+            <input id="c-employee_count" class="form-control" name="row[employee_count]" type="text" data-rule="required">
         </div>
     </div>
     <div class="form-group">

+ 1 - 1
application/admin/view/company_info/edit.html

@@ -8,7 +8,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Employee_count')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-employee_count" min="0" class="form-control" name="row[employee_count]" type="number" value="{$row.employee_count|htmlentities}" data-rule="required">
+            <input id="c-employee_count" class="form-control" name="row[employee_count]" type="text" value="{$row.employee_count|htmlentities}" data-rule="required">
         </div>
     </div>
     <div class="form-group">

+ 0 - 3
database/migrations/20260814_add_news_intro_business_scope.sql

@@ -1,3 +0,0 @@
-ALTER TABLE `fa_news`
-    ADD COLUMN `intro` TEXT NULL COMMENT '简介' AFTER `content`,
-    ADD COLUMN `business_scope` TEXT NULL COMMENT '经营范围' AFTER `intro`;

+ 0 - 2
database/migrations/20260814_change_company_info_total_sales_to_text.sql

@@ -1,2 +0,0 @@
-ALTER TABLE `fa_company_info`
-    MODIFY COLUMN `total_sales` VARCHAR(100) NOT NULL COMMENT '产品总销售额';

+ 0 - 67
database/migrations/20260814_create_company_info.sql

@@ -1,67 +0,0 @@
--- 保留公司动态分类 1~5;仅移除曾错误添加到 fa_news 的公司信息字段。
-ALTER TABLE `fa_news`
-    MODIFY COLUMN `type` ENUM('1', '2', '3', '4', '5') NULL DEFAULT NULL
-        COMMENT '动态类型:1=产品动态,2=公司动态,3=首页公司简介,4=公司介绍,5=生产管理';
-
-SET @drop_address = (
-    SELECT IF(COUNT(*) > 0, 'ALTER TABLE `fa_news` DROP COLUMN `address`', 'SELECT 1')
-    FROM information_schema.COLUMNS
-    WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fa_news' AND COLUMN_NAME = 'address'
-);
-PREPARE company_info_stmt FROM @drop_address;
-EXECUTE company_info_stmt;
-DEALLOCATE PREPARE company_info_stmt;
-
-SET @drop_employee_count = (
-    SELECT IF(COUNT(*) > 0, 'ALTER TABLE `fa_news` DROP COLUMN `employee_count`', 'SELECT 1')
-    FROM information_schema.COLUMNS
-    WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fa_news' AND COLUMN_NAME = 'employee_count'
-);
-PREPARE company_info_stmt FROM @drop_employee_count;
-EXECUTE company_info_stmt;
-DEALLOCATE PREPARE company_info_stmt;
-
-SET @drop_total_sales = (
-    SELECT IF(COUNT(*) > 0, 'ALTER TABLE `fa_news` DROP COLUMN `total_sales`', 'SELECT 1')
-    FROM information_schema.COLUMNS
-    WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'fa_news' AND COLUMN_NAME = 'total_sales'
-);
-PREPARE company_info_stmt FROM @drop_total_sales;
-EXECUTE company_info_stmt;
-DEALLOCATE PREPARE company_info_stmt;
-
-CREATE TABLE IF NOT EXISTS `fa_company_info` (
-    `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
-    `address` VARCHAR(255) NOT NULL COMMENT '公司总部地址',
-    `employee_count` INT UNSIGNED NOT NULL COMMENT '员工数量',
-    `total_sales` VARCHAR(100) NOT NULL COMMENT '产品总销售额',
-    `createtime` BIGINT NULL DEFAULT NULL COMMENT '创建时间',
-    `updatetime` BIGINT NULL DEFAULT NULL COMMENT '更新时间',
-    PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司信息';
-
-INSERT IGNORE INTO `fa_auth_rule`
-(`type`, `pid`, `name`, `title`, `icon`, `url`, `condition`, `remark`, `ismenu`, `menutype`, `extend`, `py`, `pinyin`, `createtime`, `updatetime`, `weigh`, `status`)
-VALUES
-('file', 0, 'company_info', '公司信息', 'fa fa-building', '', '', '', 1, NULL, '', 'gsxx', 'gongsixinxi', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal');
-
-SET @company_info_pid = (SELECT `id` FROM `fa_auth_rule` WHERE `name` = 'company_info' LIMIT 1);
-
-INSERT IGNORE INTO `fa_auth_rule`
-(`type`, `pid`, `name`, `title`, `icon`, `url`, `condition`, `remark`, `ismenu`, `menutype`, `extend`, `py`, `pinyin`, `createtime`, `updatetime`, `weigh`, `status`)
-VALUES
-('file', @company_info_pid, 'company_info/index', '查看', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/add', '添加', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/edit', '编辑', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/del', '删除', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/multi', '批量更新', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal');
-
--- 为现有“普通管理员”角色追加公司信息权限;重复执行不会重复追加。
-SET @company_info_rules = (
-    SELECT GROUP_CONCAT(`id` ORDER BY `id` SEPARATOR ',')
-    FROM `fa_auth_rule`
-    WHERE `name` IN ('company_info', 'company_info/index', 'company_info/add', 'company_info/edit', 'company_info/del', 'company_info/multi')
-);
-UPDATE `fa_auth_group`
-SET `rules` = CONCAT_WS(',', NULLIF(`rules`, ''), @company_info_rules)
-WHERE `id` = 2 AND FIND_IN_SET(@company_info_pid, `rules`) = 0;

+ 0 - 40
database/migrations/20260814_create_company_info_only.sql

@@ -1,40 +0,0 @@
--- 仅同步“公司信息”模块:不会修改 fa_news 或公司动态数据。
-CREATE TABLE IF NOT EXISTS `fa_company_info` (
-    `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
-    `address` VARCHAR(255) NOT NULL COMMENT '公司总部地址',
-    `employee_count` INT UNSIGNED NOT NULL COMMENT '员工数量',
-    `total_sales` VARCHAR(100) NOT NULL COMMENT '产品总销售额',
-    `createtime` BIGINT NULL DEFAULT NULL COMMENT '创建时间',
-    `updatetime` BIGINT NULL DEFAULT NULL COMMENT '更新时间',
-    PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公司信息';
-
--- 兼容已创建旧表(总销售额为数值)的情况,改为允许汉字文本。
-ALTER TABLE `fa_company_info`
-    MODIFY COLUMN `total_sales` VARCHAR(100) NOT NULL COMMENT '产品总销售额';
-
-INSERT IGNORE INTO `fa_auth_rule`
-(`type`, `pid`, `name`, `title`, `icon`, `url`, `condition`, `remark`, `ismenu`, `menutype`, `extend`, `py`, `pinyin`, `createtime`, `updatetime`, `weigh`, `status`)
-VALUES
-('file', 0, 'company_info', '公司信息', 'fa fa-building', '', '', '', 1, NULL, '', 'gsxx', 'gongsixinxi', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal');
-
-SET @company_info_pid = (SELECT `id` FROM `fa_auth_rule` WHERE `name` = 'company_info' LIMIT 1);
-
-INSERT IGNORE INTO `fa_auth_rule`
-(`type`, `pid`, `name`, `title`, `icon`, `url`, `condition`, `remark`, `ismenu`, `menutype`, `extend`, `py`, `pinyin`, `createtime`, `updatetime`, `weigh`, `status`)
-VALUES
-('file', @company_info_pid, 'company_info/index', '查看', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/add', '添加', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/edit', '编辑', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/del', '删除', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal'),
-('file', @company_info_pid, 'company_info/multi', '批量更新', 'fa fa-circle-o', '', '', '', 0, NULL, '', '', '', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), 0, 'normal');
-
--- 给当前项目的“普通管理员”角色追加菜单权限;可重复执行。
-SET @company_info_rules = (
-    SELECT GROUP_CONCAT(`id` ORDER BY `id` SEPARATOR ',')
-    FROM `fa_auth_rule`
-    WHERE `name` IN ('company_info', 'company_info/index', 'company_info/add', 'company_info/edit', 'company_info/del', 'company_info/multi')
-);
-UPDATE `fa_auth_group`
-SET `rules` = CONCAT_WS(',', NULLIF(`rules`, ''), @company_info_rules)
-WHERE `id` = 2 AND FIND_IN_SET(@company_info_pid, `rules`) = 0;