v1.0.26: 渠道新增计划增加「发生地址」字段(来源详情后,单行文本,详细到门牌号) - 列表列+新增/编辑表单+接口+迁移SQL

This commit is contained in:
nanguaboss
2026-08-09 14:57:27 +08:00
parent 2ed8cc00e7
commit b68232bff3
5 changed files with 20 additions and 9 deletions
+6 -5
View File
@@ -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),