'待执行', 'ongoing' => '进行中', 'completed' => '已完成', 'cancelled' => '已取消', ]; // 计划节点不会有"进行中",执行节点默认就是已完成 $statusOptions = $category === 'plan' ? ['planned', 'completed', 'cancelled'] : ['completed', 'ongoing', 'planned', 'cancelled']; // 起点 / 终点:库里的 JSON 先解出来,再让上一次提交的原始值覆盖它 $sLocRaw = json_decode_field($n['start_location'] ?? null); $eLocRaw = json_decode_field($n['end_location'] ?? null); $sLoc = [ 'name' => $oldStr('start_location_name', $sLocRaw['name'] ?? ''), 'address' => $oldStr('start_location_address', $sLocRaw['address'] ?? ''), 'lat' => $oldStr('start_location_lat', $sLocRaw['lat'] ?? ''), 'lng' => $oldStr('start_location_lng', $sLocRaw['lng'] ?? ''), ]; $eLoc = [ 'name' => $oldStr('end_location_name', $eLocRaw['name'] ?? ''), 'address' => $oldStr('end_location_address', $eLocRaw['address'] ?? ''), 'lat' => $oldStr('end_location_lat', $eLocRaw['lat'] ?? ''), 'lng' => $oldStr('end_location_lng', $eLocRaw['lng'] ?? ''), ]; // 时间:优先用上一次提交的三段式(_date/_hour/_minute),否则用库里存的 $startTimeVal = old_dt('start_time', $n['start_time'] ?? null); $endTimeVal = old_dt('end_time', $n['end_time'] ?? null); /* 参与人在表单里直接勾(不必先保存再回详情页加人)。 回填优先:上次提交失败时,用刚勾的而不是库里的。 */ $familyUsers = $familyUsers ?? []; $nodeMemberIds = $nodeMemberIds ?? []; $oldMembers = isset($_SESSION['_old']) && is_array($_SESSION['_old']) ? (array)($_SESSION['_old']['members'] ?? []) : null; $pickedMembers = static function () use ($oldMembers, $nodeMemberIds): array { $src = $oldMembers ?? $nodeMemberIds; $out = []; foreach ((array)$src as $v) { $v = (int)$v; if ($v > 0) { $out[] = $v; } } return $out; }; $picked = $pickedMembers(); /** * 交通信息只留一个输入框:飞机只要航班号(航空公司是隐含的),火车只要车次。 * 座位号/登机口这类「一趟车多人同行」时根本没法记,所以不再收集。 */ $tripField = [ 'plane' => ['label' => '航班号', 'ph' => '例如:CA1234'], 'train' => ['label' => '车次', 'ph' => '例如:G1234'], 'bus' => ['label' => '班次', 'ph' => '例如:T108、8 路'], 'subway' => ['label' => '线路', 'ph' => '例如:地铁 10 号线'], 'ship' => ['label' => '航次', 'ph' => '例如:渤海轮渡 3 号'], 'taxi' => ['label' => '叫车备注', 'ph' => '例如:尾号 1234'], 'other' => ['label' => '车次 / 班次', 'ph' => '例如:G1234、CA1234'], ]; ?>
活动: = e($activity['title']) ?> · 由计划节点生成