From b68232bff301e37eb4c289c0ce7133ddecea4eac Mon Sep 17 00:00:00 2001 From: nanguaboss <602995148@qq.com> Date: Sun, 9 Aug 2026 14:57:27 +0800 Subject: [PATCH] =?UTF-8?q?v1.0.26:=20=E6=B8=A0=E9=81=93=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A2=9E=E5=8A=A0=E3=80=8C=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=E3=80=8D=E5=AD=97=E6=AE=B5(=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E8=AF=A6=E6=83=85=E5=90=8E,=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC,=E8=AF=A6=E7=BB=86=E5=88=B0=E9=97=A8?= =?UTF-8?q?=E7=89=8C=E5=8F=B7)=20-=20=E5=88=97=E8=A1=A8=E5=88=97+=E6=96=B0?= =?UTF-8?q?=E5=A2=9E/=E7=BC=96=E8=BE=91=E8=A1=A8=E5=8D=95+=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3+=E8=BF=81=E7=A7=BBSQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/channel/plan_list.php | 2 +- api/channel/plan_save.php | 11 ++++++----- sql/migration_v1.0.25.sql | 8 ++++++++ static/js/channel.js | 6 ++++-- static/js/config.js | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 sql/migration_v1.0.25.sql 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渠道类别来源详情发生地址所属行业时间窗口剩余天数备注说明状态反馈费用(元)创建时间
' + ' ' + @@ -225,6 +225,7 @@ $(function () { '' + r.id + '' + '' + escHtml(r.channel_type) + '' + '' + escHtml((r.source_detail || '-').substring(0, 16)) + '' + + '' + escHtml((r.occurrence_address || '-').substring(0, 20)) + '' + '' + escHtml(r.industry || '-') + '' + '' + escHtml(win) + '' + '' + (r.remaining_days > 0 ? '' + r.remaining_days + ' 天' : '已到期') + '' + @@ -234,7 +235,7 @@ $(function () { '' + fmtDate(r.created_at) + ''; }); if (!rows.length) { - html = '暂无渠道新增计划'; + html = '暂无渠道新增计划'; } $('#plan-tbody').html(html); bindPlanInlineEdit(); @@ -328,6 +329,7 @@ $(function () { '
' + '
' + '
' + + '
' + '