diff --git a/api/channel/plan_list.php b/api/channel/plan_list.php index 161fe6c..dd8829f 100644 --- a/api/channel/plan_list.php +++ b/api/channel/plan_list.php @@ -41,7 +41,7 @@ $total = (int)$stmt->fetchColumn(); $offset = ($page - 1) * $limit; $stmt = $pdo->prepare( - "SELECT id, channel_type, source_detail, industry, start_date, end_date, remark, status, cost, created_at, updated_at + "SELECT id, channel_type, source_detail, occurrence_address, industry, start_date, end_date, remark, status, cost, created_at, updated_at FROM channel_plans WHERE $whereSql ORDER BY id DESC diff --git a/api/channel/plan_save.php b/api/channel/plan_save.php index df39fe9..4a92cb2 100644 --- a/api/channel/plan_save.php +++ b/api/channel/plan_save.php @@ -2,7 +2,7 @@ /** * 渠道新增计划保存接口 POST /api/channel/plan_save.php * 入参:id(可选,编辑时传)/ channel_type(渠道类别=source_channel 枚举,新增时必填)/ - * source_detail / industry / start_date / end_date / remark / status(待启动|已执行|错过)/ cost(费用(元)) + * source_detail / occurrence_address(发生地址)/ industry / start_date / end_date / remark / status(待启动|已执行|错过)/ cost(费用(元)) * 说明:编辑(传 id)时仅更新提交的字段,便于列表行内实时改状态/费用。 */ require_once __DIR__ . '/../common/db.php'; @@ -52,7 +52,7 @@ if ($id > 0) { Response::error('计划不存在'); } // 只更新提交的字段 - foreach (['channel_type', 'source_detail', 'industry', 'start_date', 'end_date', 'remark', 'status'] as $k) { + foreach (['channel_type', 'source_detail', 'occurrence_address', 'industry', 'start_date', 'end_date', 'remark', 'status'] as $k) { $collect($k); } if (isset($_POST['cost'])) { @@ -76,9 +76,10 @@ if ($channelType === '') { Response::error('渠道类别(channel_type)为必填项', 400); } $fields = [ - 'channel_type' => $channelType, - 'source_detail' => strOrNull($_POST['source_detail'] ?? null), - 'industry' => strOrNull($_POST['industry'] ?? null), + 'channel_type' => $channelType, + 'source_detail' => strOrNull($_POST['source_detail'] ?? null), + 'occurrence_address' => strOrNull($_POST['occurrence_address'] ?? null), + 'industry' => strOrNull($_POST['industry'] ?? null), 'start_date' => strOrNull($_POST['start_date'] ?? null), 'end_date' => strOrNull($_POST['end_date'] ?? null), 'remark' => strOrNull($_POST['remark'] ?? null), diff --git a/sql/migration_v1.0.25.sql b/sql/migration_v1.0.25.sql new file mode 100644 index 0000000..3fe90f5 --- /dev/null +++ b/sql/migration_v1.0.25.sql @@ -0,0 +1,8 @@ +-- ============================================================ +-- SuperLink Web - v1.0.25 数据库结构变更 +-- 渠道新增计划增加「发生地址」字段(详细到门牌号,单行文本) +-- ============================================================ +SET NAMES utf8mb4; + +ALTER TABLE `channel_plans` + ADD COLUMN `occurrence_address` VARCHAR(255) NULL DEFAULT NULL COMMENT '发生地址(详细到门牌号)' AFTER `source_detail`; diff --git a/static/js/channel.js b/static/js/channel.js index dad2043..aa6fe37 100644 --- a/static/js/channel.js +++ b/static/js/channel.js @@ -67,7 +67,7 @@ $(function () { ' ' + ' ' + '
| ID | 渠道类别 | 来源详情 | 所属行业 | 时间窗口 | 剩余天数 | 备注说明 | 状态反馈 | 费用(元) | 创建时间 | |
|---|---|---|---|---|---|---|---|---|---|---|
| ID | 渠道类别 | 来源详情 | 发生地址 | 所属行业 | 时间窗口 | 剩余天数 | 备注说明 | 状态反馈 | 费用(元) | 创建时间 |