其他 #440
Updated by Xihua Fan about 1 year ago
*Background* # New requirement for v4.0 OTS See: OneDrive\赤蓝商贸(上海)有限公司\Shanghai Group - IT\开发相关\OTS V4\开发需求 *Task Details* * *Rule* Rule # %{color:red}TO-DO%: ENGINE = MyISAM -> InnoDB # %{color:red}DONE%: Don’t need to specify the length or precision for your *numeric* data. # %{color:red}DONE%: Remain the default text type > utf8mb3_general_ci * *Record all SQL changes (v4)*: ENGINE = MyISAM -> InnoDB |. Issue |. SQL | | #441 | <pre> ALTER TABLE `ots_order_status` ADD COLUMN `code` INT NOT NULL AFTER `name`, ADD COLUMN `hex` VARCHAR(32) NOT NULL DEFAULT '' AFTER `code`; TRUNCATE TABLE ots_order_status; INSERT INTO `ots_order_status` (`order_status_id`, `language_id`, `name`, `code`, `hex`) VALUES (7, 1, 'Completed', 80, '#92d050'), (6, 2, 'Labelled', 0, '#0099ff'), (6, 1, 'Labelled', 0, '#0099ff'), (5, 2, 'Packing', 60, '#ffe699'), (5, 1, 'Packing', 60, '#ffe699'), (4, 2, 'P-Finished', 50, '#66ffff'), (4, 1, 'P-Finished', 50, '#66ffff'), (3, 2, 'P-Started', 30, '#fce4d6'), (3, 1, 'P-Started', 30, '#fce4d6'), (2, 2, 'New', 20, '#ffffff'), (2, 1, 'New', 20, '#ffffff'), (1, 2, 'Sample', 10, '#e7e6e6'), (1, 1, 'Sample', 10, '#e7e6e6'), (7, 2, 'Completed', 80, '#92d050'), (8, 1, 'Shipped', 70, '#cc99ff'), (8, 2, 'Shipped', 70, '#cc99ff');</pre> | | #441 | <pre>ALTER TABLE ots_order_status ADD COLUMN status TINYINT NOT NULL DEFAULT '1' AFTER hex;</pre> | * *Record all SQL changes (v3)* |. Issue |. SQL | | #441 | <pre>CREATE TABLE `t_user_order_product` ( `id` INT NOT NULL AUTO_INCREMENT, `user_id` INT NOT NULL, `order_product_id` INT NOT NULL, `create_time` datetime NOT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), KEY `order_product_id` (`order_product_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;</pre> | | #441 | <pre>ALTER TABLE `t_user_search` ADD COLUMN `is_default` TINYINT NOT NULL DEFAULT '0' AFTER `search_data`;</pre> | *v4 coding standard:* # Git提交 #xxx(redmine number): xxx(redmine title) - xxx(任意:补充内容) # 代码规范 2.1: 结构:Public -> Protected -> Private 2.2: 其他代码规范同SBX # 数据层规范(Model) 3.1: 数据库操作只应出现在model或者system中。 3.2: v3/v4的model分为两个文件,比如: order.php, order_v3.php # 前台代码 twig, js, css (js, css尽量写在单独的css文件中) # 后台代码 MVCL (L:en,cn) # 注释 ## 类名: <pre> /** * xxx * * @copyright RedBlue-OTS 2024 * @version v4 * */ </pre> ## 函数名:参数类型 + 返回值类型 <pre> /** * xxx * * @param xxx $xxx * @param xxx $xxx * @return xxx */ </pre> *Output* * Report and Solution *Others*